Files
kotlin/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.kt
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

13 lines
213 B
Kotlin

//no nested class access via instance reference error
fun test() {
A.Default.f(<!TYPE_MISMATCH!>""<!>)
}
class A() {
class object {
object f {
fun invoke(i: Int) = i
}
}
}