use correct nullability information when generating equality checks in pattern matching (KT-2148)

This commit is contained in:
Dmitry Jemerov
2012-06-02 17:59:19 +02:00
parent d46379acf2
commit f909745d1b
3 changed files with 38 additions and 10 deletions
@@ -0,0 +1,10 @@
fun f(p: Int?): Int {
return when(p) {
null -> 3
else -> p!!
}
}
fun box(): String {
return if (f(null) == 3) "OK" else "fail"
}