[LL FIR] FileStructure: accurate processing of generated declarations inside classes

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
This commit is contained in:
Dmitrii Gridin
2023-10-10 15:05:34 +02:00
committed by Space Team
parent 1a01dd4dd4
commit 4d29d6e3b4
11 changed files with 89 additions and 68 deletions
@@ -1,19 +0,0 @@
Diagnostics from elements:
for PSI element of type KtNameReferenceExpression at (2,15-27)
UNRESOLVED_REFERENCE text ranges: [(23,35)]
PSI: KtNameReferenceExpression at (2,15-27)
for PSI element of type KtNameReferenceExpression at (3,10-20)
UNRESOLVED_REFERENCE text ranges: [(45,55)]
PSI: KtNameReferenceExpression at (3,10-20)
for PSI element of type KtNameReferenceExpression at (4,10-20)
UNRESOLVED_REFERENCE text ranges: [(65,75)]
PSI: KtNameReferenceExpression at (4,10-20)
for PSI element of type KtNameReferenceExpression at (5,15-30)
UNRESOLVED_REFERENCE text ranges: [(90,105)]
PSI: KtNameReferenceExpression at (5,15-30)
for PSI element of type KtNameReferenceExpression at (6,12-21)
UNRESOLVED_REFERENCE text ranges: [(117,126)]
PSI: KtNameReferenceExpression at (6,12-21)
for PSI element of type KtNameReferenceExpression at (7,12-21)
UNRESOLVED_REFERENCE text ranges: [(138,147)]
PSI: KtNameReferenceExpression at (7,12-21)
@@ -1,4 +1,19 @@
Diagnostics from elements:
for PSI element of type KtNameReferenceExpression at (2,15-27)
UNRESOLVED_REFERENCE text ranges: [(23,35)]
PSI: KtNameReferenceExpression at (2,15-27)
for PSI element of type KtNameReferenceExpression at (3,10-20)
UNRESOLVED_REFERENCE text ranges: [(45,55)]
PSI: KtNameReferenceExpression at (3,10-20)
for PSI element of type KtNameReferenceExpression at (4,10-20)
UNRESOLVED_REFERENCE text ranges: [(65,75)]
PSI: KtNameReferenceExpression at (4,10-20)
for PSI element of type KtNameReferenceExpression at (5,15-30)
UNRESOLVED_REFERENCE text ranges: [(90,105)]
PSI: KtNameReferenceExpression at (5,15-30)
for PSI element of type KtNameReferenceExpression at (6,12-21)
UNRESOLVED_REFERENCE text ranges: [(117,126)]
PSI: KtNameReferenceExpression at (6,12-21)
for PSI element of type KtNameReferenceExpression at (7,12-21)
UNRESOLVED_REFERENCE text ranges: [(138,147)]
PSI: KtNameReferenceExpression at (7,12-21)
@@ -1,4 +0,0 @@
Diagnostics from elements:
for PSI element of type KtNameReferenceExpression at (4,5-15)
UNRESOLVED_REFERENCE text ranges: [(90,100)]
PSI: KtNameReferenceExpression at (4,5-15)
@@ -1 +1,4 @@
Diagnostics from elements:
for PSI element of type KtNameReferenceExpression at (4,5-15)
UNRESOLVED_REFERENCE text ranges: [(90,100)]
PSI: KtNameReferenceExpression at (4,5-15)
@@ -1,4 +0,0 @@
Diagnostics from elements:
for PSI element of type KtNameReferenceExpression at (6,17-27)
UNRESOLVED_REFERENCE text ranges: [(147,157)]
PSI: KtNameReferenceExpression at (6,17-27)
@@ -1 +1,4 @@
Diagnostics from elements:
for PSI element of type KtNameReferenceExpression at (6,17-27)
UNRESOLVED_REFERENCE text ranges: [(147,157)]
PSI: KtNameReferenceExpression at (6,17-27)