We should try to find supe type refs in a session firstly, otherwise
we can try to access by getResolvedSuperTypeRefsForOutOfSessionDeclaration
^KT-56550
We can omit this step in LL FIR because, according to the contract,
an outer class must be resolved before nested class
Also, it drops unsafe access to superTypeRefs from FIR transformer
^KT-56550
We must resolve a non-local declaration before access
if we want to jump from local to it to avoid possible problems
with parallel resolution
^KT-56550
The previous implementation had issues with
locks, publication and performance
Also, this change fixed a problem with mixed cycle inheritance
^KT-56550
^KTIJ-25430 Fixed
^KTIJ-23520 Fixed
^KT-57623 Fixed
^KTIJ-25372 Fixed
^KT-58357 Fixed
This is needed for signature tests to work with the same golden data
on both K1 and K2, since sometimes K1 and K2 produce IR with different
order of declarations and supertypes.
Only Fir2IrJvmResultsConverter respected
the IGNORE_FIR2IR_EXCEPTIONS_IF_FIR_CONTAINS_ERRORS test directive.
Fir2IrJsResultConverter didn't.
This is fixed here.
Previously, updateTypeInBuilderInference was calling
updateTypeFromSmartcast to actually perform type update in
implicit receiver after stub types was inferred
Such action results in creation of following FIR:
FirSmartCastExpression(
original=FQAE(FirImplicitThisReference, typeRef=R|Inv<Stub>|)
typeRef=R|Inv<String>|
)
in receiver position during completion of calls
However, it wasn't the case in general situation due to
action of FirStubTypeTransformer, which, in turn visits and updates
type ref inside original expression, but only if there was at
least one call (that was completed) using that implicit receiver
As after such type update updateTypeFromSmartcast function does
nothing
Yet in situation, when there was only partially resolved calls
referencing that implicit receiver we actually create smart-cast
expression and don't update type
The change just removes usage of updateTypeFromSmartcast and
replaces is with direct type update
We still mutate state of implicit receiver, potentially
improperly, it should be addressed in future
^KT-54708
^KT-58365 Fixed
This commit is intended to avoid the second resolve of delegate when
we need to consider provideDelegate() possibility in inference.
Also here we provide correct completion of synthetic calls during
delegate inference.
#KT-58013 Fixed
Some tests use environment variables JDK_8, JDK_11, and JDK_17.
To ensure that the tests work out of the box,
we should set these variables in the tests.
These two functions apparently are represented in Kotlin as methods
of `kotlin.String`. Because of that we accidentally treated them as
builtins.
To also minimize such cases, added filtration by return type. We are
allowing to interpret only these functions that have primitive or
unsigned return type.
#KT-57028 Fixed