The root cause of the exception is that we missed such an element, and
it led to unresolved declaration during iteration over file declarations
^KT-65562 Fixed
- 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
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
- In addition to file declarations and class members, we also need to
commit pending diagnostics on declarations in scripts, to honor
suppressions before the diagnostics are committed indiscriminately.
^KT-62899
- `scriptUninitializedTopLevelProperty` is currently disabled in FIR
because it fails with a mismatch between diagnostics from the file and
the individual elements. It will be enabled in the next commit.
^KT-62899
- In KT-62899, diagnostics produced by file checkers weren't suppressed
because the top-level declarations on which the diagnostics are
reported were never visited by the same reporter.
`LLFirDiagnosticVisitor` skips nested declarations by design, as
diagnostics are collected for each structure element separately.
However, suppression takes effect when diagnostics are committed on
some element. If the element is not visited, suppression is skipped
and the diagnostic is committed at the end without a check by
`FileStructureElementDiagnosticsCollector.collectForStructureElement`.
- The fix ensures that diagnostics are committed on top-level
declarations, similar to how this was already done for class members.
^KT-62899 fixed
- `testConflictingOverloadsAtTopLevel` is currently disabled in FIR
because it fails with a mismatch between diagnostics from the file and
the individual elements. It will be enabled in the next commit.
^KT-62899
We should process generated property as a part of the primary constructor.
This was already implemented in 8387ea8a, but some parts were missed.
ClassDiagnosticRetriever:
* dropped relation to properties generated from constructor parameters
as they should belong to the primary constructor only
* accurate logic to fully visit an implicit primary constructor to be
able to process nested declarations (e.g., inside a super type call)
SingleNonLocalDeclarationDiagnosticRetriever:
* add relation to generated properties as now they fully belong to
the constructor
FileElementFactory:
* dropped explicit resolution of generated properties from a constructor
* added explicit resolution of generated enum members for consistency.
Effectively, this is not required because we don't have compiler
checkers for such generated enum member declarations
ClassDeclarationStructureElement:
* do not collect mapping for generated properties from constructor
* explicitly declare that we should process only ClassDelegationField
^KT-62437 Fixed
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