mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
17 lines
332 B
Kotlin
Vendored
17 lines
332 B
Kotlin
Vendored
// !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField
|
|
|
|
class Outer {
|
|
private companion object {
|
|
val result = "OK"
|
|
}
|
|
|
|
class Nested {
|
|
fun foo() = object {
|
|
override fun toString(): String = result
|
|
}
|
|
}
|
|
|
|
fun test() = Nested().foo().toString()
|
|
}
|
|
|
|
fun box() = Outer().test() |