KT-2457 Verify error when comparing not null value with null in when
backend-side changes
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fun foo(i: Int, j: Int?): String =
|
||||
when (i) {
|
||||
j -> "OK"
|
||||
else -> "Fail"
|
||||
}
|
||||
|
||||
fun box(): String = foo(0, 0)
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo(i: Int) : Int =
|
||||
when (i) {
|
||||
1 -> 1
|
||||
null -> 1
|
||||
else -> 1
|
||||
}
|
||||
|
||||
fun box() : String = if (foo(1) == 1) "OK" else "fail"
|
||||
Reference in New Issue
Block a user