The issue is that during binding fake overrides, the compiler doesn't
differ setters from its properties, so the compiler uses the same
visibility for setter and entire property.
Changing logic at the binding stage can cause some unpredictable consequences so
the fix is to do this differentiation right at the reporting stage
^KT-56662 Fixed
Merge-request: KT-MR-9565
Merged-by: Michail Zarečenskij <Mikhail.Zarechenskiy@jetbrains.com>
- `LLFirCombinedJavaSymbolProvider` combines multiple
`JavaSymbolProvider`s. Its advantages are: combined index access,
caching, classpath order disambiguation.
- Scopes can still be optimized with a combined scope instead of a naive
union scope.
^KT-57207 fixed
Add a special annotation @JsExternalTypeArgument for
marking function parameters. The marked parameter
accepts an argument with an external type only.
^KT-57479 Fixed
This commit sets a list of `KtElement` as the return type of
`ShortenCommand::invokeShortening()`. It allows us to take the result
i.e., shortened PSIs. This can be used, for example, when we want to
run code-format only on the shortened PSI after running the reference
shortener.
^KT-57636 Fixed
If property call receiver is something real (like another property or a
function call), then it should not be shortened because the semantics
might change
^KTIJ-25232 Fixed
It was working incorrectly, because we've been trying to fix
P1 variable to intersectTypes(String?, StubForP2) that should result
to String? because we've got stubEqualsToAnything enabled there,
but nullability was being chosen incorrectly because
`StubForP2.isNullableType()` returned false
NB: The code inside `is ConeTypeVariable` case wasn't working properly
because it always `lookupTag.toSymbol(session)` always returned null,
thus there was effectively five dead lines of code there.
^KT-57814 Fixed
^KT-57921 Related
The existing K2 reference shortener collects all the PSI elements to
shorten. As a result, it possibly shortens duplicated PSI elements. For
example,
```
// FILE: main.kt
package a.b.c
fun test(n: Int) {
return if (<expr>x.y.z.Outer.Inner.VALUE0 > x.y.z.Outer.Inner.VALUE1</expr>) 1
else n
}
// FILE: values.kt
package x.y.z
class Outer {
object Inner {
val VALUE0 = 13
val VALUE1 = 17
}
}
```
for the above code, the existing K2 reference shortener tried to shorten
- x.y.z.Outer.Inner -> Inner
- x.y.z.Outer.Inner.VALUE0 -> VALUE0
- x.y.z.Outer.Inner -> Inner
- x.y.z.Outer.Inner.VALUE1 -> VALUE1
`x.y.z.Outer.Inner` is included in the list to shorten twice.
When it actually shortens the PSI elements, it shortens only
- x.y.z.Outer.Inner.VALUE0 -> VALUE0
- x.y.z.Outer.Inner.VALUE1 -> VALUE1
but it imports all of
- x.y.z.Outer.Inner
- x.y.z.Outer.Inner.VALUE0
- x.y.z.Outer.Inner.VALUE1
As a result, it has unnecessary additional import directives.
This commit fixes the issue by avoiding duplicated shortening for a
single PSI element.
The change in `FirDiagnosticsHandler` ensures
`DEBUG_INFO_DYNAMIC` is still reported in
`FirPsiJsOldFrontendDiagnosticsTestGenerated.testConventions`.
Support `SPREAD_OPERATOR_IN_DYNAMIC_CALL` and
`WRONG_OPERATION_WITH_DYNAMIC`
Add a special annotation @JsExternalInheritorsOnly for marking
external interfaces and classes. The marked interface or class
can’t be a parent for non external interfaces, classes or objects.
^KT-57423 Fixed
This will allow IDE plugins to contribute compiler plugins to analysis,
above and beyond those used for the actual compilation step. These
plugins can be used to, for example, provide declarations for code that
is generated during build by an external tool.
^KT-57763 fixed
- `SymbolProviderMerger` encapsulates some boilerplate, which should
make `mergeDependencySymbolProvidersInto` easier to read and also much
easier to extend.
- This Caffeine cache is limited to classes for now, but may also be
tried with callables.
- The cache has a small memory footprint, but still avoids most of the
unnecessary index accesses. In my local tests, this approach takes 50%
of the time compared to no caches. A full cache has no performance
advantage over the limited-size cache in my local tests.
- `NullableCaffeineCache` wraps a Caffeine cache and allows storing
`null` values returned by the computation in the form of explicit
`NullValue`s in the cache.
- Our current FIR caches are based on `ConcurrentMap` and thereby do not
support size and lifetime limits out of the box. For example,
first-layer caches with a limited size can speed up access of the most
frequently used elements, while having a small memory footprint.
- Caffeine is a modern and well optimized caching library that allows us
to create thread-safe and performant caches with various size or
lifetime limits.
- The cache must support concurrency because session components such as
symbol providers may be accessed concurrently once parallel resolve in
the Analysis API has been implemented (see KT-55750). Caffeine caches
support concurrency.
- Getting top-level names from `declarationProvider` directly instead of
from subordinate symbol providers has a lot of potential for
performance, but the current performance of the index access is worse
than the iterative version because scopes aren't optimized yet.
- This commit prepares `LLFirCombinedKotlinSymbolProvider` for the
switch to getting top-level names from `declarationProvider`.
- `LLFirCombinedKotlinSymbolProvider` combines multiple
`LLFirProvider$SymbolProvider`s. Its advantages are: combined "names
in package" optimization, caching, combined index access, classpath
order disambiguation.
- Scopes can still be optimized with a combined scope instead of a naive
union scope.
^KT-57314 fixed
- If a `KtClassLikeDeclaration` or all `KtFile`s which contain a
callable are already known, they can now be passed to
`LLFirProvider$SymbolProvider` directly. This avoids index accesses in
`providerHelper`.
Result of the `checkNotNull` calls should always be a non-nullable
values.
The simplest idea how to acheive it is adding not-nullable Any bound
to the type parameter declaration.
Existing comment stating about impossibility of such bound seems to be
not 100% correct because it doesn't take into account presence of
definitely-non-nullable X & Any types that allow described case with
nullable generic.
^KT-55804 Fixed
- In performance tests, modification trackers were incorrectly
incremented between tests for binary modules even with library caches
enabled. The new option `includeBinaryTrackers` can be used by
performance tests to exclude binary modules.