Files
kotlin-fork/compiler/testData/codegen/box/closures/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt
T
Dmitry Petrov 3c09a26e16 KT-5248 Don't wrap variable if it is captured only in inlined closures
Remove non-escaping Ref's on bytecode postprocessing pass.
2017-03-13 09:04:31 +03:00

19 lines
288 B
Kotlin
Vendored

// WITH_RUNTIME
fun box(): String {
run {
run {
var x = 0
run { ++x }
if (x == 0) return "fail"
}
run {
var x = 0
run { x++ }
if (x == 0) return "fail"
}
}
return "OK"
}