K2: report empty intersection warnings from completion properly

This commit is contained in:
Mikhail Glukhikh
2023-03-02 10:25:21 +01:00
committed by Space Team
parent 47fab61716
commit a3f0e429e3
12 changed files with 38 additions and 129 deletions
@@ -13,7 +13,7 @@ fun <T: A> emptyNullableListOfA(): List<T>? = null
fun testExclExcl() {
<!INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION("T; a/A, kotlin/Int; final class and interface")!>doList<!>(emptyNullableListOfA()!!) //should be an error here
val l: List<Int> = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.List<a.A & kotlin.Int>")!>id(emptyNullableListOfA()!!)<!>
val l: List<Int> = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.List<a.A & kotlin.Int>")!><!INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION!>id<!>(emptyNullableListOfA()!!)<!>
doList(strangeNullableList { doInt(it) }!!) //lambda should be analyzed (at completion phase)
}