[FIR] Check standalone companion object qualifiers are visible

This commit is contained in:
Brian Norman
2023-09-06 18:25:21 -05:00
committed by Space Team
parent 2603077db9
commit e6669b51d4
11 changed files with 97 additions and 17 deletions
@@ -3,9 +3,10 @@ package foo
fun test() {
A.d
A.Companion.<!INVISIBLE_REFERENCE!>f<!>
B.D
CCC
B.<!INVISIBLE_REFERENCE!>D<!>
<!INVISIBLE_REFERENCE!>CCC<!>
CCC.<!INVISIBLE_REFERENCE!>classObjectVar<!>
E.F.G
}
class A() {
@@ -28,3 +29,10 @@ class CCC() {
val classObjectVar = 3
}
}
class E {
class F {
companion object G
}
private companion object
}
@@ -6,6 +6,7 @@ fun test() {
B.<!INVISIBLE_MEMBER!>D<!>
<!INVISIBLE_MEMBER!>CCC<!>
CCC.<!INVISIBLE_MEMBER!>classObjectVar<!>
E.F.G
}
class A() {
@@ -28,3 +29,10 @@ class CCC() {
val classObjectVar = 3
}
}
class E {
class F {
companion object G
}
private companion object
}
@@ -60,4 +60,32 @@ package foo {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
public final class E {
public constructor E()
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
private companion object Companion {
private constructor Companion()
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 final class F {
public constructor F()
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 companion object G {
private constructor G()
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
}
}
}
}
@@ -12,6 +12,8 @@
/b.kt:(225,226): error: Cannot access 'class B : Any': it is private in file.
/b.kt:(234,235): error: Cannot access 'companion object Companion : Any': it is private in 'a/C'.
/b.kt:(243,244): error: Cannot access 'class D : Any': it is private in file.
/b.kt:(263,264): error: Cannot access 'class B : Any': it is private in file.
@@ -41,7 +41,7 @@ import a.<!INVISIBLE_REFERENCE!>D<!>.<!INVISIBLE_REFERENCE!>Companion<!>.quux
fun test() {
f(A)
f(<!INVISIBLE_REFERENCE!>B<!>)
f(C)
f(<!INVISIBLE_REFERENCE!>C<!>)
f(<!INVISIBLE_REFERENCE!>D<!>)
A.foo()