- PSI tree change events from the IDE aren't necessarily paired. For
example, when we delete a contract statement via `PsiElement.delete`,
only "after removal" PSI tree change events will be published.
- Previously, the declaration modification service would not see such
contract removal as an out-of-block modification because it didn't see
the already removed contract in the associated function. As there is
no "before removal" event, the service had no chance to discover the
contract removal.
- This fix adds the removed element as a property of `ModificationType`.
While the element will already be removed and its parent will be a
dummy holder, we can still analyze its PSI to determine whether it is
a contract.
^KT-63538 fixed
- The root cause of the exception in KT-62982 is that symbol light
classes are accessed in dumb mode (see KT-63490). Nonetheless, we can
patch the exception by supporting `EnumGeneratedDeclaration` in
`getContainingPsi`.
- To create a symbol from the containing PSI,
`KtFirSymbolContainingDeclarationProvider` will still try and fail to
find the enum class symbol via symbol providers, but it'll fall back
to a designators search in the same `FirFile`, which will find the
symbol without index access (see `findSourceNonLocalFirDeclaration` in
LL API's `declarationUtils.kt`).
^KT-62982 fixed
- This commit rewords the coding conventions around `KtAnalysisSession`
and forbids usage of class context receivers. As explained in the
KDoc, classes opaquely capture their context receivers as properties,
which is a high-risk source of leakage.
Some boolean expressions could be transformed into `IrWhen`
node. To understand that this node is actually
a boolean expression, we need to analyze its origin.
#KT-62683
We should grab static scope before in the same way as scopesBefore
to not get already updated static scope with nested scopes.
Also, we should restore such "before" snapshots to avoid their modification
(this can be reproduced with in the next commit)
^KT-63042
We are resolving delegated constructor call in the wrong context
```
TYPES:
FILE: [ResolvedTo(IMPORTS)] superTypeCallNameClash.kt
public? open [ResolvedTo(SUPER_TYPES)] class Base : R|kotlin/Any|
public? final? [ResolvedTo(TYPES)] class MyClass : R|second/Base| {
public? [ResolvedTo(TYPES)] [ContainingClassKey=MyClass] constructor(): R|second/MyClass| {
LAZY_super<R|second/MyClass.Base|> // should be R|second/Base|
}
public? open [ResolvedTo(RAW_FIR)] class Base : R|kotlin/Any|
}
```
^KT-63042
This commit does two things:
- Reorders methods so that after we enable auto-generation the git diff
is clearer
- Adds explicit return types to all `IrElementTransformerVoid` methods
for the same purpose
No semantic changes in this commit.
The test allocates a lot of memory and can cause OOM-killer on Linux
with 16 Gb RAM or less kill Gradle daemon.
Merge-request: KT-MR-13131
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
Fix swiftc path in the performance infrastructure. It has a separate
plugin to regular native-build-tools.
This fixes failures caused by the 3aeca1956e.
See also MR-KT-12948
Merge-request: KT-MR-13130
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
This property allows changing log level for message printing the final
set of compiler arguments used to run compilation.
Possible levels are 'error', 'warning', 'info', 'debug'. Default level
is 'debug'.
^KT-60733 Fixed
At the moment, there is no good way to meaningfully filter `this`
expressions. The filters for the reference shortener can work only with
symbols, and it does not make a lot of sense to check any particular
symbol when deciding whether to shorten a labeled `this` expression.
We would probably need a better API for the shortener to be able
to filter more precisely (see KT-63555)
^KT-62675 Fixed
When both sides of an equality expression are null or Nothing?, only the
right side is receiving implications within the data-flow. Make sure the
left side has implications add as well. This is important for boolean
conditions when implications from both sides need to be combined.
^KT-63535 Fixed
Assert reasonable compile avoidance when basic changes are made in a
multiplatform project
^Relates to KT-56963
Merge-request: KT-MR-13032
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
- `runWriteCommandAction`, which is required for PSI modification
functions like `PsiElement.delete`, must be invoked on the EDT.
However, instead of `runWriteCommandAction` we can use
`runUndoTransparentAction`, which does not need to be run on the EDT
and fulfills the same requirement.
^KT-63560
- We cannot configure the application's write action accessibility on a
per-test basis because (1) the application may be shared across
concurrent tests and (2) the application is usually cached, so the
configuration will be missed entirely.
- There is actually a much easier solution to allow write access
selectively: We can enable it in `runWriteAction` blocks, and keep it
in a thread local to support concurrent test runs. As Analysis API
tests never call `runWriteAction`, there will be no "analyze cannot be
called from a write action" error, and if `analyze` is somehow called
from a write action, it will now be caught.
^KT-63560 fixed
In this commit we now require a class-like symbol
(and not a more general classifier symbol) whenever possible.
Exceptional situation with a type parameter is now handled
in Synthetics.kt
Related to KT-63569