CFG exhaustive when else instruction for KT-8700
This commit is contained in:
committed by
Mikhail Glukhikh
parent
697228eae0
commit
b805ce06c2
@@ -0,0 +1,22 @@
|
||||
fun foo(a: Boolean, b: Boolean): Int {
|
||||
val x: Int
|
||||
if (a) {
|
||||
x = 1
|
||||
}
|
||||
when (b) {
|
||||
true -> <!VAL_REASSIGNMENT!>x<!> = 2
|
||||
false -> x = 3
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
fun bar(a: Boolean, b: Boolean): Int {
|
||||
val x: Int
|
||||
if (a) {
|
||||
x = 1
|
||||
}
|
||||
when (b) {
|
||||
false -> <!VAL_REASSIGNMENT!>x<!> = 3
|
||||
}
|
||||
return <!UNINITIALIZED_VARIABLE!>x<!>
|
||||
}
|
||||
Reference in New Issue
Block a user