[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
@@ -18,7 +18,7 @@ fun test() {
// ISSUE: KT-27999
// ISSUE: KT-30244
fun test_1() {
<!DEBUG_INFO_EXPRESSION_TYPE("() -> {Comparable<{Int & String}> & java.io.Serializable}")!>select(
<!DEBUG_INFO_EXPRESSION_TYPE("() -> {Comparable<*> & java.io.Serializable}")!>select(
{ 1 },
{ "" }
)<!>
@@ -107,7 +107,7 @@ fun case_8() {
val x3 = Test.id(A(null))
val result_1 = select(x1, x2, x3)
<!DEBUG_INFO_EXPRESSION_TYPE("A<out {Comparable<{Int & String}> & java.io.Serializable}?>?")!>result_1<!>
<!DEBUG_INFO_EXPRESSION_TYPE("A<out {Comparable<*>? & java.io.Serializable?}>?")!>result_1<!>
}
fun case_9() {
@@ -116,7 +116,7 @@ fun case_9() {
val x3 = A(Test.id(A('s')))
val result_1 = select(x1, x2, x3)
<!DEBUG_INFO_EXPRESSION_TYPE("A<out A<out {Comparable<{Char & Int & String}> & java.io.Serializable}>?>")!>result_1<!>
<!DEBUG_INFO_EXPRESSION_TYPE("A<out A<out {Comparable<*> & java.io.Serializable}>?>")!>result_1<!>
}
fun case_10() {