[FIR2IR] Automatically store IR declaration in its parent upon creation

Previously, creating a declaration with Fir2IrCallableDeclarationsGenerator/
  Fir2IrClassifiersGenerator didn't guarantee that this declaration will
  be actually added to the list of parent class/file declarations, which
  lead to situations when FIR2IR created some declarations in the air
  (mostly fake-overrides)
This commit is contained in:
Dmitriy Novozhilov
2023-10-05 12:39:13 +03:00
committed by Space Team
parent 22f55b3dc4
commit 3d6ec0ec75
96 changed files with 417 additions and 2062 deletions
@@ -54,6 +54,10 @@ FILE fqName:<root> fileName:/FakeOverrideInAnonymousWithDelegation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Bar]'
FIELD DELEGATE name:$$delegate_0 type:<root>.Wrapper.dummy.<no name provided> visibility:private [final]
EXPRESSION_BODY
CALL 'private final fun <get-dummy> (): <root>.Wrapper.dummy.<no name provided> declared in <root>.Wrapper' type=<root>.Wrapper.dummy.<no name provided> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Wrapper declared in <root>.Wrapper' type=<root>.Wrapper origin=null
PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val]
overridden:
public open foo: kotlin.String
@@ -67,10 +71,6 @@ FILE fqName:<root> fileName:/FakeOverrideInAnonymousWithDelegation.kt
CALL 'public open fun <get-foo> (): kotlin.String declared in <root>.Bar' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.Wrapper.dummy.<no name provided> visibility:private [final]' type=<root>.Wrapper.dummy.<no name provided> origin=null
receiver: GET_VAR '<this>: <root>.Wrapper.bar.<no name provided> declared in <root>.Wrapper.bar.<no name provided>.<get-foo>' type=<root>.Wrapper.bar.<no name provided> origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.Wrapper.dummy.<no name provided> visibility:private [final]
EXPRESSION_BODY
CALL 'private final fun <get-dummy> (): <root>.Wrapper.dummy.<no name provided> declared in <root>.Wrapper' type=<root>.Wrapper.dummy.<no name provided> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Wrapper declared in <root>.Wrapper' type=<root>.Wrapper origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Bar