[FIR] Report NONE_APPLICABLE on callable references with multiple failed candidates

This commit is contained in:
Kirill Rakhman
2023-11-07 15:33:31 +01:00
committed by Space Team
parent 6d2ab92d91
commit d54068b8ab
12 changed files with 33 additions and 31 deletions
+12 -12
View File
@@ -27,22 +27,22 @@ interface Foo {
// CR on property with to receivers are forbidden
fun <T: Foo> test() {
// with LHS and property
bar8<T>(Foo::<!UNRESOLVED_REFERENCE!>x1<!>)
bar8<Foo>(Foo::<!UNRESOLVED_REFERENCE!>x1<!>)
bar8(Foo::<!UNRESOLVED_REFERENCE!>x1<!>)
bar8<T>(Foo::<!NONE_APPLICABLE!>x1<!>)
bar8<Foo>(Foo::<!NONE_APPLICABLE!>x1<!>)
bar8(Foo::<!NONE_APPLICABLE!>x1<!>)
// with LHS and mutable property
bar8<T>(Foo::<!UNRESOLVED_REFERENCE!>x2<!>)
bar8<Foo>(Foo::<!UNRESOLVED_REFERENCE!>x2<!>)
bar8(Foo::<!UNRESOLVED_REFERENCE!>x2<!>)
bar8<T>(Foo::<!NONE_APPLICABLE!>x2<!>)
bar8<Foo>(Foo::<!NONE_APPLICABLE!>x2<!>)
bar8(Foo::<!NONE_APPLICABLE!>x2<!>)
// with LHS and propery + mutable property (mixed)
bar8<T>(Foo::<!UNRESOLVED_REFERENCE!>x3<!>)
bar8<Foo>(Foo::<!UNRESOLVED_REFERENCE!>x3<!>)
bar8(Foo::<!UNRESOLVED_REFERENCE!>x3<!>)
bar9<T>(Foo::<!UNRESOLVED_REFERENCE!>x3<!>)
bar9<Foo>(Foo::<!UNRESOLVED_REFERENCE!>x3<!>)
bar9(Foo::<!UNRESOLVED_REFERENCE!>x3<!>)
bar8<T>(Foo::<!NONE_APPLICABLE!>x3<!>)
bar8<Foo>(Foo::<!NONE_APPLICABLE!>x3<!>)
bar8(Foo::<!NONE_APPLICABLE!>x3<!>)
bar9<T>(Foo::<!NONE_APPLICABLE!>x3<!>)
bar9<Foo>(Foo::<!NONE_APPLICABLE!>x3<!>)
bar9(Foo::<!NONE_APPLICABLE!>x3<!>)
}
}
@@ -6,5 +6,5 @@ fun foo(i: Long) {}
fun bar(f: (Boolean) -> Unit) {}
fun test() {
bar(::<!UNRESOLVED_REFERENCE!>foo<!>)
bar(::<!NONE_APPLICABLE!>foo<!>)
}
@@ -5,5 +5,5 @@ fun foo(x: Float) = 10f
fun foo(x: String) = ""
fun main() {
bar(::<!UNRESOLVED_REFERENCE!>foo<!>) // no report about unresolved callable reference for `foo`
bar(::<!NONE_APPLICABLE!>foo<!>) // no report about unresolved callable reference for `foo`
}