Fix internal compiler error on importing invisible fake reference
Note that this is not relevant for LOCAL/INHERITED visibilities:
- for LOCAL visibility it's impossible to have a qualifier
- INHERITED is an intermediate visibility, we enhance it later
(see resolveUnknownVisibilityForMember)
#KT-20356 Fixed
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
|||||||
|
// FILE: A.kt
|
||||||
|
|
||||||
|
import B.<!INVISIBLE_REFERENCE!>foo<!>
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
<!INVISIBLE_MEMBER!>foo<!>
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: B.kt
|
||||||
|
object B : C<String>()
|
||||||
|
|
||||||
|
// FILE: C.kt
|
||||||
|
|
||||||
|
open class C<T> {
|
||||||
|
private var foo: String = "abc"
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun test(): kotlin.Unit
|
||||||
|
|
||||||
|
public object B : C<kotlin.String> {
|
||||||
|
private constructor B()
|
||||||
|
invisible_fake final override /*1*/ /*fake_override*/ var foo: kotlin.String
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
|
||||||
|
public open class C</*0*/ T> {
|
||||||
|
public constructor C</*0*/ T>()
|
||||||
|
private final var foo: kotlin.String
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
@@ -8765,6 +8765,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.kt");
|
runTest("compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("invisibleFakeReferenceInImport.kt")
|
||||||
|
public void testInvisibleFakeReferenceInImport() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/imports/invisibleFakeReferenceInImport.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("JavaPackageLocalClassNotImported.kt")
|
@TestMetadata("JavaPackageLocalClassNotImported.kt")
|
||||||
public void testJavaPackageLocalClassNotImported() throws Exception {
|
public void testJavaPackageLocalClassNotImported() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/imports/JavaPackageLocalClassNotImported.kt");
|
runTest("compiler/testData/diagnostics/tests/imports/JavaPackageLocalClassNotImported.kt");
|
||||||
|
|||||||
Generated
+5
@@ -8765,6 +8765,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
|||||||
runTest("compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.kt");
|
runTest("compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("invisibleFakeReferenceInImport.kt")
|
||||||
|
public void testInvisibleFakeReferenceInImport() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/imports/invisibleFakeReferenceInImport.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("JavaPackageLocalClassNotImported.kt")
|
@TestMetadata("JavaPackageLocalClassNotImported.kt")
|
||||||
public void testJavaPackageLocalClassNotImported() throws Exception {
|
public void testJavaPackageLocalClassNotImported() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/imports/JavaPackageLocalClassNotImported.kt");
|
runTest("compiler/testData/diagnostics/tests/imports/JavaPackageLocalClassNotImported.kt");
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ public class Visibilities {
|
|||||||
public static final Visibility INVISIBLE_FAKE = new Visibility("invisible_fake", false) {
|
public static final Visibility INVISIBLE_FAKE = new Visibility("invisible_fake", false) {
|
||||||
@Override
|
@Override
|
||||||
public boolean mustCheckInImports() {
|
public boolean mustCheckInImports() {
|
||||||
throw new IllegalStateException("This method shouldn't be invoked for INVISIBLE_FAKE visibility");
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user