Retain data flow info after conditions in if-statements
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
fun ifThen(x: Int?) {
|
||||
if (x!! == 0) {
|
||||
x : Int
|
||||
}
|
||||
x : Int
|
||||
}
|
||||
|
||||
fun ifElse(x: Int?) {
|
||||
if (x!! == 0) else {
|
||||
x : Int
|
||||
}
|
||||
x : Int
|
||||
}
|
||||
|
||||
fun ifThenElse(x: Int?) {
|
||||
if (x!! == 0) {
|
||||
x : Int
|
||||
} else {
|
||||
x : Int
|
||||
}
|
||||
x : Int
|
||||
}
|
||||
|
||||
fun ifIs(x: Int?, cond: Boolean) {
|
||||
if ((x is Int) == cond) {
|
||||
<!TYPE_MISMATCH!>x<!> : Int
|
||||
}
|
||||
<!TYPE_MISMATCH!>x<!> : Int
|
||||
}
|
||||
Reference in New Issue
Block a user