Files
kotlin/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedOnce.kt
2018-12-21 16:20:45 +01:00

19 lines
298 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
fun almostAlwaysTrue() = true
fun test() {
lateinit var z: String
run {
if (almostAlwaysTrue()) {
z = ""
}
}
println(z)
println(z)
println(z)
}
// 0 IFNULL
// 1 IFNONNULL
// 1 throwUninitializedPropertyAccessException