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:
+5
-10
@@ -52,14 +52,13 @@ class TestJFoo : IFoo {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#<$$delegate_0> = JFoo()
|
||||
}
|
||||
|
||||
override fun foo(): String {
|
||||
return <this>.#<$$delegate_0>.foo()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: IFoo
|
||||
local /* final field */ val <$$delegate_0>: IFoo = JFoo()
|
||||
|
||||
}
|
||||
|
||||
@@ -68,14 +67,13 @@ class TestK1 : IFoo {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#<$$delegate_0> = K1()
|
||||
}
|
||||
|
||||
override fun foo(): String {
|
||||
return <this>.#<$$delegate_0>.foo()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: IFoo
|
||||
local /* final field */ val <$$delegate_0>: IFoo = K1()
|
||||
|
||||
}
|
||||
|
||||
@@ -84,14 +82,13 @@ class TestK2 : IFoo {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#<$$delegate_0> = K2()
|
||||
}
|
||||
|
||||
override fun foo(): String {
|
||||
return <this>.#<$$delegate_0>.foo()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: IFoo
|
||||
local /* final field */ val <$$delegate_0>: IFoo = K2()
|
||||
|
||||
}
|
||||
|
||||
@@ -100,14 +97,13 @@ class TestK3 : IFoo {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#<$$delegate_0> = K3()
|
||||
}
|
||||
|
||||
override fun foo(): String {
|
||||
return <this>.#<$$delegate_0>.foo()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: IFoo
|
||||
local /* final field */ val <$$delegate_0>: IFoo = K3()
|
||||
|
||||
}
|
||||
|
||||
@@ -116,14 +112,13 @@ class TestK4 : IFoo {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#<$$delegate_0> = K4()
|
||||
}
|
||||
|
||||
override fun foo(): String {
|
||||
return <this>.#<$$delegate_0>.foo()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: IFoo
|
||||
local /* final field */ val <$$delegate_0>: IFoo = K4()
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user