- KT-62895 cannot be reproduced on the Analysis API side. Still, it is
useful to add tests here for better coverage in the future.
- The reason is likely that Analysis API tests specifically use
`SealedClassesInheritorsCaclulatorPreAnalysisHandler` to compute
sealed class inheritors (which are usually the breaking point for
problems in `when` exhaustiveness checking), so the tests do not use
the production implementation. See KT-64505 for future work on this
problem.
^KT-62895
This way, even if the whole qualifier is not selected, but some of its
parts are, the reference shortener will correctly find and shorten
those parts
^KTIJ-28080 Fixed
In the 'IGNORE_SELF' mode, dangling files don't have their own
declarations in providers. As a result, all references there resolve to
declarations of the original file. It is conceptually similar to that we
had in on-air resolve, however, now it's possible to work with the whole
content of the in-memory 'FirFile'.
As it can be seen in 'ProjectStructureProvider.kt'
(KtFile.danglingFileResolutionMode), the 'IGNORE_SELF' mode is
automatically applied for non-physical files with an original file being
set. For other scenarios, now there is a new 'analyzeCopy()' function
that allows to pass the analysis mode explicitly.
Utilize `FirSamResolver` to obtain the potential SAM constructor
from the classifier
Also, accept K2_SYNTHETIC_RESOLVED in the `resolveUnqualifiedAccess`,
since this is the kind of resolve success which corresponds to the
SAM constructor call resolution
^KTIJ-28167 Fixed
This allows to properly report them as used in `KtFirImportOptimizer`
This change will also be important for properly fixing KTIJ-28167,
since `computeImportableName` is also used in reference shortener
^KTIJ-28385 Fixed
findClasses works over regular `PsiElementFinder`, which doesn't know
about out ClassId conception. So, `a/b/A.B` and `a/b/A/B` are the same
from `FqName` point of view.
`FirJavaFacade` has this check, so this problem appears only in the case
of combined provider.
^KT-62892 Fixed
We should materialize delegated declarations to process callables
in scopes correctly. Standalone mode works the same way as it
deserialize directly into FIR.
Another solution is to rework proto and stub serializer/deserializer to
restore FirFields like `$$delegate_0` correctly to work with
`FirDelegatedMemberScope`
^KT-62896 Fixed
^KT-64584 Fixed
We cannot load nested class without an outer as in this case we will
miss a symbol of the outer class, which is crucial in some cases
(e.g., during status calculation).
So we have to load the topmost class as it will load all nested classes
with the correct context as well
^KT-62891 Fixed
We should use the declaration-site session to have stable
resolution order. The same scheme is applicable during
regular lazy resolution calls
^KT-63547
We should use the declaration-site session to have stable
resolution order. The same scheme is applicable during
regular lazy resolution calls.
^KT-63547 Fixed
'ContextCollector' is used for computing context of 'FirCodeFragment's.
Code fragments themselves might contain additional smart cast operations
that modify the context receiver stack.
^KT-63056 Fixed
We should unwrap substitution overrides as they sometimes cannot be
resolved on demand. We already have this in KDoc contract.
```kotlin
class MyClass {
val prop = object : LazySchemeProcessor<Int, Int>() {
override fun is<caret>SchemeFile(name: CharSequence) = name != "str"
}
}
abstract class LazySchemeProcessor<SCHEME : Number, MUTABLE_SCHEME : SCHEME> {
open fun isSchemeFile(name: CharSequence) = true
}
```
In this case, we will try to resolve fake override in the context of the
anonymous object, and it will fail because we cannot lazily resolve
local declarations as they are a part of the containing declarations
(KT-64243 for more details)
^KT-64108 Fixed