FIR: introduce delegate field initializers

Before this commit we initialized delegate fields in primary constructor,
that could provoke NPE in case delegate is used in initializer of
some property backing field.
Now we initialize delegate fields directly instead.
This commit is contained in:
Mikhail Glukhikh
2021-02-02 17:51:11 +03:00
parent 2cbdad0bb1
commit d4b0688690
69 changed files with 928 additions and 356 deletions
@@ -3,7 +3,6 @@ class Impl : A, B {
super/*Any*/()
/* <init>() */
<this>.#<$$delegate_0> = b
}
override fun add(element: String?): Boolean {
@@ -51,7 +50,7 @@ class Impl : A, B {
return <this>.#<$$delegate_0>.<get-size>()
}
local /* final field */ val <$$delegate_0>: B
local /* final field */ val <$$delegate_0>: B = b
}