Files
kotlin/compiler/testData/codegen/bytecodeText/doNotStoreNullsForCapturedVars.kt
Dmitry Petrov 786ac46fa6 Do not store nulls for captured variables going out of scope
These values can't be read after going out of scope.
JVM implementation can take care of such object references on its own.
Ref objects for captured variables are not different from any other
objects stored in local variables, so there's really no reason to
nullify these references explicitly.

 #KT-18478 Fixed Target versions 1.1.4
2017-06-20 13:31:36 +03:00

14 lines
168 B
Kotlin
Vendored

fun runNoInline(block: ()-> Unit): Unit {
block()
}
fun use(x: Int) {}
fun test(): Unit {
var x = 0
runNoInline {
use(x)
}
}
// 0 ACONST_NULL