- In contrast to other kinds of dependencies, `dependsOn` dependencies
must be followed transitively.
- Add `transitiveDependsOnDependencies` to `KtModule`. These
dependencies are calculated lazily with a topological sort. They are
added to the dependency provider when it's built in
`LLFirSessionFactory`.
^KT-55329 fixed
- `IncDecOperatorsInExpectClass.kt` should produce an
`ACTUAL_WITHOUT_EXPECT` in K2 (see KT-55177). This went unnoticed
because of KT-55570.
- A similar multi-module test for K1 and K2 has been added, called:
`multiplatform/incDecOperatorsInExpectClass.kt`.
- FirExpectActualMatcherTransformer: Instead of returning,
`transformMemberDeclaration` must assign an empty map to
`expectForActualData` so that `FirExpectActualDeclarationChecker`
doesn't assume that the member declaration needs no expect-actual
checking.
^KT-55570 fixed
^ KTIJ-24385
Temp property to store receiver is generated for `a.b++` expression.
If this property's psi corresponds to receiver expr, then FirProperty
would be found by mapper if receiver is requested.
It works unexpectedly, because FirProperty is normally not expected by expression.
This change set fake sources for generated FirProperty, so it won't be found
by source psi
Currently, designation path requires all intermediate classes to be
regular named classes. This is not certainly possible, especially for
invalid cases such as:
---
class Foo {
object {
class Bar {
fun foo() {} // What's the designation path for 'foo()'?
}
}
}
---
If there was a way to get a parent for a given FIR element, we could
just follow parents until the root FIR node (which would be a FirFile).
'LLFirProvider'/'LLFirProviderHelper' do not normally search for classes
in the 'kotlin.' package. While it has a positive impact on performance,
as 'kotlin.' package is normally forbidden in arbitrary modules,
during designation path calculation we need to handle also invalid
cases.
As 'initialiseVirtualFileFinderServices()' that is run during
test initialization collects transitive dependencies, all of them
must be ready. However, 'KtNotUnderContentRootModuleForTest' has a
built-in dependency provided by 'LLFirBuiltinsSessionFactory'.
Before, 'FirSession's for not-under content root modules were stored in
a project-global service, which essentially means that even if one
creates a non-cached 'LLFirResolveSession', 'FirSession's for such
modules will be cached and reused later. Such exact behavior happened in
sealed class inheritor pre-analysis handler.
In some cases, 'LLFirProvider' doesn't return the existing class, e.g.
when the class is inside the 'kotlin.' package but when the
'-Xallow-kotlin-package' flag is not passed.
This fixes the test 'DiagnosisCompilerTestFE10TestdataTestGenerated.
TestsWithStdLib.testInaccessibleInternalClass()'.'
The old 'FirProviderInterceptor' is too invasive, ad-hoc, and only a
few places in the compiler are aware of it.
This fixes the test 'FirOnAirResolveTestGenerated#testOnAirTypesResolve'
which started failing after the designation path collection refactoring.
The newly appeared class existence check started to fail:
```
val declaration = firProvider.getFirClassifierByFqName(classId)
check(declaration != null)
```
Indices are not available in the IDE for files outside content roots,
and the newly introduced 'PsiFile' can be used for searching
classifiers instead.
Callable symbols with SinceKotlin are filtered out by a
resolution stage, but in K1 classifiers and property accessors
report API_NOT_AVAILABLE. K2 filters out properties with
unavailable accessors, but does nothing for classifiers.
This change fixes it.
^KT-54410 Fixed
^ KTIJ-24373
when resolving selector expr of a dot qualified expression,
parent qualified expression is resolved
see `KtFirCallResolver.getContainingDotQualifiedExpressionForSelectorExpression`,
Fir is filled with the data. Then,
during final mapping from Fir -> psi, one need to perform the opposite:
take `selectionExpression` to get the initial KtCallExpression