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
@@ -0,0 +1,6 @@
fun bar(x: Int?): Int {
if (x != null) return -1
if (<!SENSELESS_COMPARISON!>x == null<!>) return -2
// Should be unreachable
return 2 + 2
}
@@ -0,0 +1,3 @@
package
public fun bar(/*0*/ x: kotlin.Int?): kotlin.Int