[NI] Consider intersection type with number type as Nothing

Currently, only for "in": In<in Int & A> == In<in Nothing> == In<*>

 #KT-37302 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-03-22 23:25:12 +03:00
parent b23aff4d0d
commit 191fb02bf6
26 changed files with 242 additions and 92 deletions
@@ -0,0 +1,12 @@
// !LANGUAGE: +NewInference
import kotlin.test.assertEquals
fun test() {
val u = when (true) {
true -> 42
else -> 1.0
}
assertEquals(42, u)
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference
import kotlin.test.assertEquals
@@ -9,5 +8,5 @@ fun test() {
else -> 1.0
}
assertEquals(42, u)
<!TYPE_INFERENCE_ONLY_INPUT_TYPES_WARNING!>assertEquals<!>(42, u)
}