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:
+4
-6
@@ -3,13 +3,8 @@ class Test : J {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#<$$delegate_0> = j
|
||||
}
|
||||
|
||||
private val j: J
|
||||
field = j
|
||||
private get
|
||||
|
||||
override fun takeNotNull(x: @EnhancedNullability String) {
|
||||
<this>.#<$$delegate_0>.takeNotNull(x = x)
|
||||
}
|
||||
@@ -36,7 +31,10 @@ class Test : J {
|
||||
return <this>.#<$$delegate_0>.returnsFlexible()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: J
|
||||
local /* final field */ val <$$delegate_0>: J = j
|
||||
private val j: J
|
||||
field = j
|
||||
private get
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user