[FIR] Report INAPPLICABLE_CANDIDATE or more specific diagnostic for callable references

... instead of just UNRESOLVED_REFERENCE when something went wrong
during resolution.

#KT-59401 related
This commit is contained in:
Kirill Rakhman
2023-11-03 13:39:27 +01:00
committed by Space Team
parent 6b7eeec181
commit d91000e39c
44 changed files with 80 additions and 78 deletions
@@ -114,14 +114,14 @@ fun <T : Foo, R: Number, D: Int> main() {
bar7(Foo::resolve) // OK
// with LHS and sentension function expected type
bar10<D>(Int::<!UNRESOLVED_REFERENCE!>x1<!>) // ERROR before the fix in NI
bar10<D>(Int::<!INAPPLICABLE_CANDIDATE!>x1<!>) // ERROR before the fix in NI
bar10<Int>(Int::x1) // OK
bar10(Int::x1) // OK
fun Int.ext() {
// with LHS and sentension function expected type
bar10<D>(::<!UNRESOLVED_REFERENCE!>x1<!>) // ERROR before the fix in NI
bar10<Int>(::<!UNRESOLVED_REFERENCE!>x1<!>) // OK
bar10(::<!UNRESOLVED_REFERENCE!>x1<!>) // OK
bar10<D>(::<!INAPPLICABLE_CANDIDATE!>x1<!>) // ERROR before the fix in NI
bar10<Int>(::<!INAPPLICABLE_CANDIDATE!>x1<!>) // OK
bar10(::<!INAPPLICABLE_CANDIDATE!>x1<!>) // OK
}
}