Files
kotlin-fork/compiler/testData/codegen/box/callableReference/property/privateSetOuterClass.kt
T
Mikhael Bogdanov 9b6fef005f Simplify LocalDeclarationsLowering, support declaration pop up via separate lower
1. Scheme of capturing local variables not touched
 2. Lowered local functions are transposed to the nearest class (including local) or file
 3. Local classes are also transpose to the nearest class (including local) or file
2019-06-27 08:07:01 +02:00

31 lines
562 B
Kotlin
Vendored

class A {
var value: String = "fail1"
private set
inner class B {
fun foo(): kotlin.reflect.KMutableProperty0<String> = this@A::value
}
}
class C {
var value: String = "fail2"
private set
fun bar(): kotlin.reflect.KMutableProperty0<String> {
class D {
fun foo(): kotlin.reflect.KMutableProperty0<String> = this@C::value
}
return D().foo()
}
}
fun box(): String {
val a = A()
a.B().foo().set("O")
val c = C()
c.bar().set("K")
return a.value + c.value
}