35c7c4afd8
When property initializer of some inner entity (e.g. anonymous object) contains a reference to some outer entity (say, a property of the outer class), we need to make sure we called "lookupInContext" on this entity's owner class, so that "setCaptureThis" was called on the appropriate closure #KT-4176 Fixed
16 lines
213 B
Kotlin
16 lines
213 B
Kotlin
trait T {
|
|
fun result(): String
|
|
}
|
|
|
|
open class B(val x: String)
|
|
|
|
class A : B("OK") {
|
|
fun foo() = object : T {
|
|
val bar = x
|
|
|
|
override fun result() = bar
|
|
}
|
|
}
|
|
|
|
fun box() = A().foo().result()
|