[FIR] If callable reference can't be resolved with expected type, try resolving with Any

In positions outside of calls (e.g. property initializers)
we resolve callable references using a synthetic outer call with the
expected type as parameter type.
If this fails, we previously returned an unresolved reference.
After this commit, we additionally try to resolve the callable reference
with expected type Any.
This lets us report more precise diagnostics like type mismatches or
when multiple overloads exist NONE_APPLICABLE.

#KT-55373 Fixed
#KT-55955 Fixed
This commit is contained in:
Kirill Rakhman
2023-07-27 18:32:16 +02:00
committed by Space Team
parent 2c91ae1129
commit ade1354a84
20 changed files with 143 additions and 79 deletions
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE