JVM_IR KT-45431 don't optimize out $$delegatedProperties in companion
Corresponding delegates are initialized in the host class, using '$$delegatedProperties'. TODO figure out proper code generation scheme for delegated properties in companions (KT-45580)
This commit is contained in:
committed by
TeamCityServer
parent
f6baabd98e
commit
73d4fa65ea
+20
@@ -0,0 +1,20 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class DP {
|
||||
operator fun provideDelegate(t: Any?, kp: KProperty<*>) =
|
||||
lazy { "OK" }
|
||||
}
|
||||
|
||||
class H1 {
|
||||
companion object {
|
||||
val property: String by DP()
|
||||
}
|
||||
}
|
||||
|
||||
class H2 {
|
||||
companion object {
|
||||
val property: String by lazy { "OK" }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user