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
This commit optimizes functions related to method signature mapping on
the JVM backend. The most significant change is avoiding re-allocations
in StringBuilder when building internal names. The commit also includes
minor optimizations, such as removing redundant allocations of strings
and other objects.
Also adds rendering of @Metadata annotations in Kapt3 and Kapt4 tests
(currently disabled for a few tests).
Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
It was already reported in the K2+PSI mode, but not LT because
BuilderFactoryForDuplicateClassNameDiagnostics relied on PSI, and did
not do anything if PSI was missing.
No tests were added because it fixes the already existing test
`compiler/testData/cli/jvm/fileClassClashMultipleFiles` after the
project is migrated to 2.0.
#KT-59586
This fixes the following
FirLightTreeDiagnosticsTestWithJvmIrBackendGenerated tests:
testPropertyInlineCycle
testInlineCycle
testSuspendInlineCycle
testIndirectInlineCycle
#KT-59586
Move language version settings, compiler configuration and different
flags there, and use this config everywhere in both backends instead of
GenerationState.
This will hopefully make GenerationState less of a "god object" and
remove the need to have it available everywhere, in particular in JVM IR
lowerings code, in the future.
Also, future refactorings will make it easier to inject backend-specific
behavior into common code, so that we would not need to handle support
of new features in the old backend.
Implementation is very similar to the `enumValues` intrinsic.
Java enums and old (pre-1.9) Kotlin enums will be supported in a
subsequent commit.
#KT-59710
Function `apiVersionIsAtLeast` was introduced to be able to have
different inline function content inlined to user code call sites
depending on their api version settings. Thus, it should not be
compile-time evaluated when being called in the body of inline stdlib
function.
^KT-59452: Fixed
Disabling of this language feature (see KT-57570) was not supported in
the (default) light tree mode, and after this change it will not be
supported in the PSI mode as well. This makes the behavior more
consistent and allows us to remove the directive
IGNORE_BACKEND_K2_LIGHT_TREE in the future (KT-56757).
If `-Xno-unified-null-checks` is specified, do not throw exceptions, but
rather revert to the old behavior, with source code in exception
messages.
Note that `-Xno-unified-null-checks` is a flag which enables behavior of
Kotlin 1.3. It can be removed once we no longer support API version 1.3.
Since we put object's hash code in toString, we end up in putting
non-stable hash code to constant table, which leads to unstable
binaries.
#KTI-1193 Fixed