[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
@@ -114,6 +114,9 @@ FILE fqName:<root> fileName:/delegationToIntersectionType.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>.B]'
FIELD DELEGATE name:$$delegate_0 type:<root>.A visibility:private [final]
EXPRESSION_BODY
GET_VAR 'val intersection: <root>.A declared in <root>.test' type=<root>.A origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.test.<no name provided>) returnType:kotlin.String
overridden:
public abstract fun foo (): kotlin.String declared in <root>.B
@@ -124,9 +127,6 @@ FILE fqName:<root> fileName:/delegationToIntersectionType.kt
$this: TYPE_OP type=<root>.B origin=IMPLICIT_CAST typeOperand=<root>.B
GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.A visibility:private [final]' type=<root>.A origin=null
receiver: GET_VAR '<this>: <root>.test.<no name provided> declared in <root>.test.<no name provided>.foo' type=<root>.test.<no name provided> origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.A visibility:private [final]
EXPRESSION_BODY
GET_VAR 'val intersection: <root>.A declared in <root>.test' type=<root>.A 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>.B
@@ -119,6 +119,9 @@ FILE fqName:<root> fileName:/delegationToIntersectionType2.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>.A]'
FIELD DELEGATE name:$$delegate_0 type:<root>.A visibility:private [final]
EXPRESSION_BODY
GET_VAR 'val intersection: <root>.A declared in <root>.test' type=<root>.A origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.test.<no name provided>) returnType:kotlin.Any
overridden:
public abstract fun foo (): kotlin.Any declared in <root>.A
@@ -129,9 +132,6 @@ FILE fqName:<root> fileName:/delegationToIntersectionType2.kt
$this: TYPE_OP type=<root>.B origin=IMPLICIT_CAST typeOperand=<root>.B
GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.A visibility:private [final]' type=<root>.A origin=null
receiver: GET_VAR '<this>: <root>.test.<no name provided> declared in <root>.test.<no name provided>.foo' type=<root>.test.<no name provided> origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.A visibility:private [final]
EXPRESSION_BODY
GET_VAR 'val intersection: <root>.A declared in <root>.test' type=<root>.A 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>.A