[FE] Always infer upper types to intersection types in K2...
...and always use old algorithm for K1 ^KT-51221
This commit is contained in:
committed by
Space Team
parent
d50c072af0
commit
ac7fddaad5
+1
-1
@@ -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> = <!INITIALIZER_TYPE_MISMATCH, NEW_INFERENCE_ERROR!>id(emptyNullableListOfA()!!)<!>
|
||||
val l: List<Int> = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.List<a.A & kotlin.Int>")!>id(emptyNullableListOfA()!!)<!>
|
||||
|
||||
doList(strangeNullableList { doInt(it) }!!) //lambda should be analyzed (at completion phase)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user