Fix closure's reference to outer closure
#KT-3276 Fixed
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
fun box(): String {
|
||||
fun foo(x: Int, s: String): String {
|
||||
fun bar(y: Int) {
|
||||
fun baz(z: Int, k: Int) {
|
||||
foo(x - 1 + k, "Fail")
|
||||
}
|
||||
|
||||
baz(y, 0)
|
||||
}
|
||||
|
||||
if (x > 0) bar(x)
|
||||
return s
|
||||
}
|
||||
|
||||
return foo(1, "OK")
|
||||
}
|
||||
Reference in New Issue
Block a user