[NI] Add resolution applicability for resolved candidates with error
New resolution applicability is needed in cases when error is found, but candidate still should be selected. Currently there are two cases, when this behaviour is required: - unstable smartcast (choose candidate with non-nullable parameter) - unknown lambda parameter type (against non-functional expected type) KT-36264
This commit is contained in:
+1
-2
@@ -1,4 +1,3 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun create(): Map<String, String> = null!!
|
||||
|
||||
operator fun <K, V> Map<K, V>.iterator(): Iterator<Map.Entry<K, V>> = null!!
|
||||
@@ -14,7 +13,7 @@ class MyClass {
|
||||
m = create()
|
||||
// See KT-7428
|
||||
for ((k, v) in <!SMARTCAST_IMPOSSIBLE!>m<!>)
|
||||
res <!NI;OVERLOAD_RESOLUTION_AMBIGUITY!>+=<!> (<!NI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>k<!>.<!NI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>length<!> <!NI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>+<!> <!NI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>v<!>.<!NI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>length<!>)
|
||||
res += (k.length + v.length)
|
||||
return res
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user