[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
@@ -17,6 +17,7 @@ class Test1<E : Any?> : IBase<E> {
}
private /* final field */ val $$delegate_0: IBase<E> = i
override fun <B : Any?> foo(a: E, b: B) {
<this>.#$$delegate_0.foo<B>(a = a, b = b)
}
@@ -34,8 +35,6 @@ class Test1<E : Any?> : IBase<E> {
(<this>.#$$delegate_0, <this>).<set-x><D>(<set-?> = <set-?>)
}
private /* final field */ val $$delegate_0: IBase<E> = i
}
class Test2 : IBase<String> {
@@ -45,6 +44,11 @@ class Test2 : IBase<String> {
}
var j: IBase<String>
field = j
get
set
override fun <B : Any?> foo(a: String, b: B) {
<this>.#j.foo<B>(a = a, b = b)
}
@@ -62,9 +66,5 @@ class Test2 : IBase<String> {
(<this>.#j, <this>).<set-x><D>(<set-?> = <set-?>)
}
var j: IBase<String>
field = j
get
set
}