Files
kotlin/compiler/testData/codegen/box/closures/captureOuterProperty/inPropertyDeepObjectChain.kt
2018-08-09 14:22:46 +03:00

19 lines
400 B
Kotlin
Vendored

interface T {
fun result(): String
}
class A(val x: String) {
fun foo() = object : T {
fun bar() = object : T {
fun baz() = object : T {
val y = x
override fun result() = y
}
override fun result() = baz().result()
}
override fun result() = bar().result()
}
}
fun box() = A("OK").foo().result()