After a generation of fake overrides some code may still to refer old
symbols from declaration storage (like computation of overridden
symbols for lazy functions), so we need to remap those symbols using
information from IR f/o generator
This change affects only mode with IR f/o generator
The old way of overridden computation with fir2ir f/o generator relied
on the fact that fir2ir generator creates IR for all f/o and fills
its caches. But with IR f/o generator enabled, we don't call fir2ir
generator, so some caches are missing. And for this mode it's enough
to acquire the symbol using the original declaration symbol and the
lookup tag of the corresponding supertype
Relates to KT-64202
There are a lot of restrictions between different parts of the pipeline.
1. Fake overrides can't be built before classes are actualized
2. Constants can't be evaluated before callables are actualized
3. Callables can't be actulaized before fake overrides are built
4. Checkers can't run before constants are evaluated
This commit reorders things to make all these restrictions happy.
^KT-63644
There are many complications with the current design of passing data
from within in-place lambdas to surrounding code. Solving these
complications will involve more time to investigation than is available
within the K2 release. So we are disabling passing type statement
information from lambdas for the time being until more time can be
devoted to a more complete solution.
^KT-60958 Fixed
^KT-63530 Fixed
The problem here is that for common session we register `FirJavaElementFinder`
which provides light classes based on expect classes. And then
at the start of analysis of jvm module we register one another
`FirJavaElementFinder`, which sees actual classes and uses them to
build light classes
But, because class ids of expect and actual class pair are the same and
element finders are ordered by creation order, when java resolve tries
to resolve some class, it founds light class based on expect class,
even if we are already in platform session
To fix this problem, it was decided to unregister all previous element
finders on creation of each new session, so old finders won't interfere
with analysis
^KT-63612 Fixed
^KT-64296
This particular test references kotlin.reflect.KProperty1 both in
common and platform sourceset. And if there is no stdlib in dependecies
it resolves to KProperty1 from builstins, which is expect (see KT-64061),
which leads to broken expectations that after IR actualization there
are no referenced expect classes
Previously when unsigned arrays were passed as vararg in a named form the necessary spread element wasn't generated, which resulted in a compilation error.
^KT-63514 fixed
This commit solves a stub type inconsistency problem.
As a part of KT-59369 fix we decided (see commit 299d2799),
that ConeStubTypeForChainInference has a scope of Any,
so we can safely resolve only to equals/hashCode/toString.
However, later we can replace a stub type with some inferred type,
which can have its own equals/hashCode/toString implementation,
while the call still refers Any member.
In this situation FIR2IR decides that we are calling a fake override,
which is not true, in fact we are calling an overriding method.
This leads to a crash in Native backend.
To solve this situation, we provide an explicit cast of a dispatch
receiver with a stub type (ConeStubTypeForChainInference) to Any,
thus confirming directly we are calling Any method and nothing else.
#KT-63932 Fixed
Context:
- Kotlin allows functions overloaded with different array element types.
- Varargs are lowered to Array parameters.
- Before this commit, K/Wasm erased an array element type
from the signature, similar to type argument erasure in other cases.
Fix:
Stop erasing type arguments in arrays when computing v-table signatures.
^KT-58852 Fixed
They were accidentally fixed with `[FIR] Process all overridden members from intersection scopes`
commit, which itself introduced incorrect behavior, which was properly
fixed with ... commit. So KT-64081 started to appear again
Previously, there was a contract that each callable symbol in the chain
of `processDirectOverriddenWithBaseScope` will be unique. And if some
symbol is accessible from multiple scopes, then only last of them will
be returned as a component of `MemberWithScope`
But after the change from previous commit, we don't have this contract anymore.
Which means that we may meet the same symbol during processing hierarchy
of overridden functions (but with different base scopes)
So if some code utilizes `process...Overridden...WithBaseScope` functions
it should consider that the same symbol may be obtained several times
^KT-63738 Fixed
In case of HMPP structure with common JVM module (e.g. shared between
JVM and Android) one can reference the same field from java code,
so it should be shared between fir2ir sessions
^KT-63574 Fixed