[NI] Discard DefNotNull types inside invariant positions
#KT-30297 Fixed #KT-32168 Fixed #KT-27722 Fixed (actually, it was fixed with addition of DefNotNullTypes, and now test was added to save this behavior) #KT-32345 Fixed
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
fun <T> foo(resources: List<T>) {
|
||||
resources.map { runCatching { it } }.<!OI;TYPE_INFERENCE_UPPER_BOUND_VIOLATED!>mapNotNull<!> { it.getOrNull() }
|
||||
}
|
||||
|
||||
fun <T: Any> bar(resources: List<T>) {
|
||||
resources.map { runCatching { it } }.mapNotNull { it.getOrNull() }
|
||||
}
|
||||
Reference in New Issue
Block a user