[IR BE] Fix capturing of var-locals inside class/field initializers
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user