KT-23397 Optimize out field for property delegate when it's safe (JVM)

This commit is contained in:
Pavel Mikhailovskii
2022-06-03 16:54:12 +02:00
committed by teamcity
parent 9ee0268197
commit 65b2cee913
83 changed files with 3015 additions and 19 deletions
@@ -0,0 +1,15 @@
// WITH_STDLIB
// CHECK_BYTECODE_LISTING
object O {
object P
init {
throw IllegalStateException("O should not be initialized")
}
}
operator fun O.P.getValue(thisRef: Any?, property: Any?) = if (thisRef == null) "OK" else "Failed"
val result by O.P
fun box(): String = result