7e6d080123
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
228 B
Kotlin
Vendored
15 lines
228 B
Kotlin
Vendored
sealed class A {
|
|
object B : A()
|
|
|
|
class C : A()
|
|
}
|
|
|
|
fun box(): String {
|
|
val a: A = A.C()
|
|
val b: Boolean
|
|
when (a) {
|
|
A.B -> b = true
|
|
is A.C -> b = false
|
|
}
|
|
return if (!b) "OK" else "FAIL"
|
|
} |