Files
Dmitrii Gridin 4d29d6e3b4 [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
2023-10-13 17:13:14 +00:00

56 lines
3.2 KiB
Plaintext
Vendored

KT element: KtClass
FIR element: FirRegularClassImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] enum class MyClass : <ERROR TYPE REF: Symbol not found for UnresolvedInterface>, R|kotlin/Enum<MyClass>| {
private [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/MyClass.i] i: R|kotlin/Int| = R|/foo|()): R|MyClass| {
super<R|kotlin/Enum<MyClass>|>()
}
public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val i: R|kotlin/Int| = R|<local>/i|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int|
public final static [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] enum entry ENTRY1: R|MyClass| = LAZY_EXPRESSION
public final static [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] enum entry ENTRY2: R|MyClass| = LAZY_EXPRESSION
public final [ResolvedTo(STATUS)] fun boo([ResolvedTo(STATUS)] a: R|kotlin/String|): R|kotlin/Unit| { LAZY_BLOCK }
public final static [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] fun values(): R|kotlin/Array<MyClass>| {
}
public final static [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] fun valueOf([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/String|): R|MyClass| {
}
public final static [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] val entries: R|kotlin/enums/EnumEntries<MyClass>|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/enums/EnumEntries<MyClass>|
}
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] enum.kt
public final [ResolvedTo(BODY_RESOLVE)] enum class MyClass : <ERROR TYPE REF: Symbol not found for UnresolvedInterface>, R|kotlin/Enum<MyClass>| {
private [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/MyClass.i] i: R|kotlin/Int| = R|/foo|()): R|MyClass| {
super<R|kotlin/Enum<MyClass>|>()
}
public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val i: R|kotlin/Int| = R|<local>/i|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int|
public final static [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] enum entry ENTRY1: R|MyClass| = LAZY_EXPRESSION
public final static [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] enum entry ENTRY2: R|MyClass| = LAZY_EXPRESSION
public final [ResolvedTo(STATUS)] fun boo([ResolvedTo(STATUS)] a: R|kotlin/String|): R|kotlin/Unit| { LAZY_BLOCK }
public final static [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] fun values(): R|kotlin/Array<MyClass>| {
}
public final static [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] fun valueOf([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/String|): R|MyClass| {
}
public final static [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] val entries: R|kotlin/enums/EnumEntries<MyClass>|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/enums/EnumEntries<MyClass>|
}
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo(): R|kotlin/Int| {
^foo Int(42)
}