K2: Avoid inference diagnostics when arguments are already error typed
For example, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER
It became especially relevant after 0e84bf2053
that together with later commits bring a lot of unnecessary
NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER diagnostic
This commit is contained in:
committed by
Space Team
parent
564b40f05d
commit
fe5adab652
-16
@@ -1,16 +0,0 @@
|
||||
|
||||
package a
|
||||
|
||||
interface Closeable {}
|
||||
class C : Closeable {}
|
||||
|
||||
fun <T: Closeable, R> T.foo(block: (T)-> R) = block
|
||||
|
||||
fun <T: Closeable, R> T.foo(block: (T, T)-> R) = block
|
||||
|
||||
fun main() {
|
||||
C().<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!> { // no ambiguity here
|
||||
www ->
|
||||
<!UNRESOLVED_REFERENCE!>xs<!>
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
package a
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ fun <K> id2(x: K, s: String): K = x
|
||||
fun <K> ret(s: String): K = TODO()
|
||||
|
||||
fun test() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>id2<!>(<!UNRESOLVED_REFERENCE!>unresolved<!>, "foo")
|
||||
id2(<!UNRESOLVED_REFERENCE!>unresolved<!>, "foo")
|
||||
id2(<!UNRESOLVED_REFERENCE!>unresolved<!>, <!ARGUMENT_TYPE_MISMATCH!>42<!>)
|
||||
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>ret<!>("foo")
|
||||
|
||||
Reference in New Issue
Block a user