Files
kotlin/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectUsedInNestedClass.kt
2018-06-22 16:53:07 +03:00

15 lines
302 B
Kotlin
Vendored

// !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField
class Outer {
private companion object {
override fun toString(): String = "OK"
}
class Nested {
fun foo(): Any = Outer.Companion
}
fun test() = Nested().foo().toString()
}
fun box() = Outer().test()