Due to possible data races configuration discovery might fail. So far,
it happened silently and we used so-called default one. This
configuration is unaware of specific implicit imports, receivers, base
class, etc. Hence, broken highlighting and navigation.
This commit introduces the following changes:
1. Having default configuration for building `FirScript` is no longer an
option. Missing configuration means error reported via exception.
2. Every configuration usage is now logged in DEBUG mode.
Troubleshooting becomes easier.
^KT-60193 fixed
Now we will resolve declarations only ones and to the
minimal required phase to get a fully resolved element
depends on an insert position, because not all elements
require body resolution
A side change: `getOnAirGetTowerContextProvider` now
won't do rebind to the original declaration. In the future,
this part will be rewritten to avoid on-air resolution,
so it is not a problem
^KT-59685 Fixed
Previously application of plugins was part of fir2ir conversion and
ir actualization was the responsibility of each specific IR backend
facade. Now (after moving IR extensions after IR actualization) those
actions are extracted into separate facade for two purposes:
1. Avoid code duplication in backend facades
2. Step with this facade goes exactly after fir2ir conversion before
irHandlersStep, which allows IR handlers to observe IR which was
actualized and modified by extensions, which is quite useful
^KT-56173
This is needed for two reasons:
1. Consistency
2. It should run after compiler plugins, which are now runs after fir2ir
is finished for all modules
^KT-56173
Before this change nodes unification was called if outer call was
completed in the FULL mode, but it may happen even if this call is
actually a part of some other outer call
Initially it was implemented via "relatedConfigurations", but these
relatedConfigurations didn't contain outgoing configurations for default
base compilations, but for KotlinJvmAndroid did. There is no reason to
check incoming configurations for dependency rewriter. So for
KotlinJvmAndroidCompilation it is enough to check their variant-specific
outgoing configurations.
^KT-58225 Verification Pending
It had a little use and even this use was causing a problem. Since
inside `maybeRegister { }` this block Gradle forbids creation of
other entities. Because this block is part of "entity configuration".
So it is recommended to replace with either
* `getOrCreate("foo", invokeWhenCreated = {})`
* or just getOrCreate("foo").apply {}
It was public api which has not much use outside KGP.
Moreover, this api has a little use so it is ok list configuration names
in place.
^KT-58225 Verification Pending
SerializerFactory is an implementation detail for Kotlin/JS and Native:
it should be added as a supertype to a companion object of certain serializable classes
and `serializer(vararg KSerializer<*>)` function from it should be implemented.
Existing implementation added the supertype, but did not add proper override to FirClass
of a companion, which led to various warnings and errors like 'Abstract function 'serializer' is not implemented in non-abstract companion object'.
Also implemented the addition of SerializerFactory supertype to user-defined companions within @Serializable and @MetaSerializable when necessary.
Also set up proper box tests for FIR+Kotlin/JS combination.
#KT-58501 Fixed
#KT-59768 Fixed
It's important to filter out failures from lazy resolve before calling other
suppressors like BlackBoxCodegenSuppressor. Otherwise other suppressors
can filter out every failure from test and keep it as ignored even if
the only problem in lazy resolve contracts, which disables with special directive
This is needed for providing types for '_DebugLabel' variables in
code fragments. Originally, there come a JVM type descriptor, so there
it's converted to a FirResolvedTypeRef reference through FirJavaTypeRef.