mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
See KT-36812. Aside from the problem stated there, D8 will throw out the entire LVT if it sees a variable that has not been written to (and will generate incorrect SSA if the slot is reused with a different type). Note: this only fixes a FIR test because it's missing an `else -> throw` branch, and default initialization satisfies the verifier and masks the incorrect control flow.
15 lines
197 B
Kotlin
Vendored
15 lines
197 B
Kotlin
Vendored
import kotlin.random.Random
|
|
|
|
fun test(): Char {
|
|
var c: Char
|
|
if (Random.nextBoolean())
|
|
c = '1'
|
|
else
|
|
c = '2'
|
|
|
|
return c
|
|
}
|
|
|
|
// 3 ISTORE 0
|
|
// 1 LOCALVARIABLE c C L1 L5 0
|