Fix optimization of property delegates of platform types

The old code didn't replace the delegate field access because it was
wrapped into a TYPE_OP IMPLICIT_NOTNULL.

 #KT-54463 Fixed
This commit is contained in:
Alexander Udalov
2022-10-18 15:00:54 +02:00
committed by Space Team
parent ac74ce5f27
commit 8812f632cc
6 changed files with 51 additions and 17 deletions
@@ -0,0 +1,22 @@
// TARGET_BACKEND: JVM
// FILE: A.java
public class A {
public static A create() { return new A(); }
}
// FILE: box.kt
import kotlin.reflect.KProperty
class C {
private val valueState = A.create()
private val value by valueState
fun get(): String = value
}
operator fun A.getValue(thisRef: Any?, property: KProperty<*>): String = "OK"
fun box(): String =
C().get()