- `getConstructorKeyword` forces an AST load due to a child search. In
most cases, we don't need to check the constructor keyword in primary
constructors at all (e.g. `class ABC()` with an implicit primary
constructor). The keyword check is only needed when there are primary
constructor modifiers (e.g. `class ABC constructor()`).
Thanks to Dima Gridin for the suggested fix.
^KT-61635 fixed
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.
- Hide allocator-specific data into Allocator::*::Impl
like with gc and gcScheduler modules.
- These *::Impl are still owned by specific GCs
- Additionally moved "stateless" allocator APIs into Allocator.hpp
Leave only bootstrap range again
This commits reverts da267ba2c8. It looks
like JPS import is possible without additional regular expressions. Also,
origin commit added too wide range of trusted versions.
KTI-1359
`KtReference` might be resolved from anywhere, even
from the write action - the call site might not know
anything about Kotlin, and might not be able to
somehow prevent the `inaccessible analysis session`
exception from being thrown. That's why we
have to be permissive here.
^KTIJ-26867 Fixed
Currently, KAPT3 uses JDK internal API to build Java AST.
Since the API is internal, it has changed in newer JDKs.
So, for them, use reflection to access new API.
#KT-59349 Fixed
It would be nice to report more appropriate diagnostics at the
corresponding places, but right now it's more important to
fix greenness-redness problems. Plus, this is already how K1 works.
^KT-59900 Fixed
K2 IDE Plugin uses only a partial set of built-ins.
It only has declarations which are not present in
the JVM stdlib as classfiles.
Because of that, some major declarations like
`kotlin.Unit` are missing,
so resolution inside kotlin stdlib common modules does not work.
Because of incorrectly resolved stdlib,
highlighting and resolution in other files in the kotlin project does not work.
This commit adds source versions of stdlib declarations
(`/core/builtins/src/kotlin/`) to the common stdlib as a source-set
for IDE import.
This way all declarations in stdlib common module are properly resolved.
The approach might be incorrect as it might introduce possible redeclaration
conflicts between common and platform stdlib sources
as `/core/builtins/src/kotlin/` source-set is also registered as a source-set for
platforms.
Now that files have a CFG, use it to validate properties are initialized
correctly. Update FirTopLevelPropertiesChecker to collect initialization
info for the property being checked - similar to
FirMemberPropertiesChecker - and validate proper initialization.
#KT-56683 Fixed
#KT-58531 Fixed
In order to properly analyze top-level property initialization, a
control-flow graph must be created for FirFiles. This change adds the
foundation for the file CFG and updates body resolve to create the CFG.
Checking the CFG for proper initialization is separated into a following
change to ease code review.
KT-56683