Smart casts to nothing after comparison with null

This commit is contained in:
Mikhail Glukhikh
2015-11-05 17:01:28 +03:00
committed by Mikhail Glukhikh
parent 981d471ebe
commit b556037915
7 changed files with 26 additions and 11 deletions
@@ -3,19 +3,19 @@ fun bar(x: Int) = x + 1
fun f1(x: Int?) {
bar(<!TYPE_MISMATCH!>x<!>)
if (x != null) bar(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>)
if (x == null) bar(x!!)
if (x == null) <!UNREACHABLE_CODE!>bar(<!><!DEBUG_INFO_SMARTCAST!>x<!>!!<!UNREACHABLE_CODE!>)<!>
}
fun f2(x: Int?) {
if (x != null) else bar(x!!)
if (x != null) else <!DEBUG_INFO_SMARTCAST!>x<!>!!
}
fun f3(x: Int?) {
if (x != null) bar(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) else bar(x!!)
if (x != null) bar(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) else <!DEBUG_INFO_SMARTCAST!>x<!>!!
}
fun f4(x: Int?) {
if (x == null) bar(x!!) else bar(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>)
if (x == null) <!DEBUG_INFO_SMARTCAST!>x<!>!! else bar(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>)
}
fun f5(x: Int?) {