[IR BE] Fix capturing of var-locals inside class/field initializers
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
|
||||
fun bar(b: ()-> Unit) { b() }
|
||||
|
||||
class C() {
|
||||
val p: Int = run {
|
||||
var v = 10
|
||||
bar() {
|
||||
v = 20
|
||||
}
|
||||
v + 1
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val c = C()
|
||||
if (c.p != 21) return "fail ${c.p}"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user