mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
17 lines
304 B
Kotlin
Vendored
17 lines
304 B
Kotlin
Vendored
// !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField
|
|
|
|
inline fun <T> run(fn: () -> T) = fn()
|
|
|
|
class Outer {
|
|
private companion object {
|
|
val result = "OK"
|
|
}
|
|
|
|
class Nested {
|
|
fun foo() = run { result }
|
|
}
|
|
|
|
fun test() = Nested().foo()
|
|
}
|
|
|
|
fun box() = Outer().test() |