Files
kotlin/compiler/testData/codegen/box/callableReference/bound/captureVarInInitBlock.kt
2019-11-19 11:00:09 +03:00

22 lines
277 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
fun bar(b: ()-> Unit) { b() }
class C() {
var f: Int
init {
var i = 10
bar {
i = 20
}
f = i + 1
}
}
fun box(): String {
val c = C()
if (c.f != 21) return "fail"
return "OK"
}