During refactoring of FIR2IR commit 8ebb4127 introduced
`FirProviderWithGeneratedFiles` for lookups for containing FIR for
generated declaration
But it broke the logic of `Fir2IrIrGeneratedDeclarationsRegistrar`,
which provides annotations for metadata from generated IR annotations
(see `containingFile` function in it), as it started to use fir
provider from the platfrom session instead of provider of the
corresponding session
So to fix this issue `FirProviderWithGeneratedFiles` was changed in the
way so it sees declarations from dependant sessions too (only with
`dependsOn` relation), which allows to use provider for the leaf
platform session for declarations from any module within the same
HMPP hierarchy
^KT-64444 Fixed
We don't have true flexible types in the IR, but we approximate it with
internal type annotations, such as FlexibleNullability,
FlexibleMutability, RawType. These annotations are then handled
specially in JvmIrTypeSystemContext, which can construct a fake flexible
type so that type checker on IR types would behave exactly as on
frontend types.
As shown in KT-63441, one instance of flexible types where flexibility
was lost during conversion to IR is Java array/vararg types. It's
necessary to support it so that IR fake overrides could be constructed
correctly, because IR fake override checker requires parameter types to
be equal. So this change introduces another internal type annotation,
FlexibleArrayElementVariance, which is only applicable to types with
classifier kotlin/Array, and which signifies that the annotated type
`Array<X>` should rather be seen as `Array<X>..Array<out X>`.
#KT-63441 Fixed
#KT-63446 Fixed
This diagnostic may be reported even without any compiler plugins (e.g.
for annotation named `Target` or `Deprecated`), so the old name
and message were quite confusing
^KT-64654
This change improves performance, as
checking callables via scopes in
`4e587157` turns out to be quite
slow, and it also prevents some redundant
diagnostics.
This is more consistent with the code of
the common compiler checkers.
It would be nice to refactor the contents
of this object further, but it's out
of scope of the current branch.
^KT-54596
Fir2IrAnnotationsFromPluginRegistrar stores elements using start and end
offsets from IR elements, which strip comments from the start offset.
So it's also needed to strip it from FIR source to keep the consistency
^KT-61872 Fixed
Test dump for klib does not correlate to real case (CLI compilation of
JS or Native), because for some reason KLib facade in MPP scenario
uses session/module of each specific file, instand of session for
leaf platform module
In CLI scenario only one session is used, so annotations are generated
properly
^KT-61833 Fixed
Adding these dependencies to the `api` configuration pollutes classpath for each dependant modules even if it doesn't need them. Instead, the dependencies should be declared more granularly if they're required
#KTI-1349 In Progress
This prevents `FirConflictsExpressionChecker.kt`
from missing conflicting local functions. It used
to due to inconsistencies in assigning `<local>`,
and this commit makes it a bit more
straightforward.
The change in KtClassTypeQualifierRenderer
prevents `FirOverrideImplementTest.testLocalClass`
from failing in `intellij`. It didn't fail for
callables, because `KtCallableSignatureRenderer`
doesn't try to render packages.
^KT-59186 Fixed
This only applies to JVM and fq-names in declaration references
in IR dumps.
This enables us to run more irText tests on platforms other than JVM
(see KT-58605).
This doesn't reduce the quality of tests, because the flags are still
printed for declarations themselves. We only omit them in references.
However, this makes the tests more compatible with non-JVM backends
(see KT-58605), because flags of referenced stdlib declarations may
differ among target platforms.
Pinning the language version is rarely the right thing to do.
This changes makes it harder to do so by requiring an additional
directive with a name that indicates to developers that they are
likely doing something dangerous.