[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
@@ -79,16 +79,16 @@ class Derived : DerivedBase, Base, Base2 {
}
private /* final field */ val $$delegate_0: Base = newBase()
override fun foo(x: String): String {
return <this>.#$$delegate_0.foo(x = x)
}
private /* final field */ val $$delegate_0: Base = newBase()
private /* final field */ val $$delegate_1: Base2 = newBase2()
override fun bar(x: String): String {
return <this>.#$$delegate_1.bar(x = x)
}
private /* final field */ val $$delegate_1: Base2 = newBase2()
init {
<set-global>(<set-?> = <get-global>().plus(other = ":Derived"))
}
@@ -102,16 +102,16 @@ class Derived1 : Base, DerivedBase, Base2 {
}
private /* final field */ val $$delegate_0: Base = newBase()
override fun foo(x: String): String {
return <this>.#$$delegate_0.foo(x = x)
}
private /* final field */ val $$delegate_0: Base = newBase()
private /* final field */ val $$delegate_1: Base2 = newBase2()
override fun bar(x: String): String {
return <this>.#$$delegate_1.bar(x = x)
}
private /* final field */ val $$delegate_1: Base2 = newBase2()
init {
<set-global>(<set-?> = <get-global>().plus(other = ":Derived"))
}
@@ -125,16 +125,16 @@ class Derived2 : Base, Base2, DerivedBase {
}
private /* final field */ val $$delegate_0: Base = newBase()
override fun foo(x: String): String {
return <this>.#$$delegate_0.foo(x = x)
}
private /* final field */ val $$delegate_0: Base = newBase()
private /* final field */ val $$delegate_1: Base2 = newBase2()
override fun bar(x: String): String {
return <this>.#$$delegate_1.bar(x = x)
}
private /* final field */ val $$delegate_1: Base2 = newBase2()
init {
<set-global>(<set-?> = <get-global>().plus(other = ":Derived"))
}