Retain data flow info after conditions in if-statements

This commit is contained in:
Alexander Udalov
2012-11-13 16:52:26 +04:00
parent 2872a0799a
commit ae77bf0a4e
3 changed files with 44 additions and 5 deletions
@@ -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
}