[FIR] Keep all failed resolution candidates and fully resolve them

Previously, when a candidate was found with an applicability that is
better than the current best applicability, all previous candidates were
thrown away. Now we keep them, unless the new applicability is
successful. If no successful candidates are found, we fully resolve all
the unsuccessful ones and select the ones with the least bad
applicability. This improves diagnostics for unresolved calls.

#KT-57844 Fixed
This commit is contained in:
Kirill Rakhman
2023-05-03 13:32:42 +02:00
committed by Space Team
parent 451daaa7c5
commit b2fa104081
44 changed files with 245 additions and 109 deletions
@@ -94,7 +94,7 @@ fun test() {
emit(null)
val x = get()
if (x == null) {
x<!UNSAFE_CALL!>.<!>toString("")
x.<!NONE_APPLICABLE!>toString<!>("")
}
""
@@ -134,7 +134,7 @@ fun test() {
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x<!UNSAFE_CALL!>.<!>toString("")
x.<!NONE_APPLICABLE!>toString<!>("")
}
""