17 lines
299 B
Kotlin
Vendored
17 lines
299 B
Kotlin
Vendored
// !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField
|
|
|
|
fun <T> eval(fn: () -> T) = fn()
|
|
|
|
class Outer {
|
|
private companion object {
|
|
val result = "OK"
|
|
}
|
|
|
|
class Nested {
|
|
fun foo() = eval { result }
|
|
}
|
|
|
|
fun test() = Nested().foo()
|
|
}
|
|
|
|
fun box() = Outer().test() |