Files
kotlin/compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInLocalObject.kt
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

15 lines
298 B
Kotlin
Vendored

// WITH_RUNTIME
fun test() {
var x = 0
run {
val obj = object {
fun foo() { ++x }
}
obj.foo()
}
}
// 1 NEW kotlin/jvm/internal/Ref\$IntRef
// 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element