Files
kotlin-fork/compiler/testData/diagnostics/tests/classObjects/ClassObjectVisibility.kt
T
Pavel V. Talanov ffabe19229 Prohibit accessing nested classes/objects of class object using class literal
The fqname of class should be clear from code
Example: can't shorten A.Default.B.Default.C to A.B.C
Also fixes problem when nested class of enum class could be accessed via enum entry
2015-03-03 13:04:29 +03:00

30 lines
394 B
Kotlin

package foo
fun test() {
A.d
A.Default.<!INVISIBLE_MEMBER!>f<!>
B.<!INVISIBLE_MEMBER!>D<!>
<!INVISIBLE_MEMBER!>CCC<!>
CCC.<!INVISIBLE_MEMBER!>classObjectVar<!>
}
class A() {
public class object {
val d = 3
private object f {
}
}
}
class B {
class D {
private class object
}
}
class CCC() {
private class object {
val classObjectVar = 3
}
}