KT-5248 Don't wrap variable if it is captured only in inlined closures
Remove non-escaping Ref's on bytecode postprocessing pass.
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun runNoInline(f: () -> Unit) = f()
|
||||
|
||||
fun test() {
|
||||
var x = 0
|
||||
runNoInline { ++x }
|
||||
}
|
||||
|
||||
// 1 NEW kotlin/jvm/internal/Ref\$IntRef
|
||||
// 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element
|
||||
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element
|
||||
Reference in New Issue
Block a user