Files
kotlin/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt
Ilmir Usmanov a52f430d8f Put default value (null or zero) to slot for uninitialized values
This way range of the variable is correct in LVT.
 #KT-24672 Fixed
2018-12-28 15:09:07 +03:00

17 lines
224 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
import kotlin.random.Random
fun test(): Char {
val c: Char
if (Random.nextBoolean())
c = '1'
else
c = '2'
return c
}
// 3 ISTORE 0
// 1 LOCALVARIABLE c C L1 L5 0