KT-23397 Optimize out field for property delegate when it's safe (JVM)
This commit is contained in:
committed by
teamcity
parent
9ee0268197
commit
65b2cee913
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// WITH_STDLIB
|
||||
// CHECK_BYTECODE_LISTING
|
||||
|
||||
enum class E {
|
||||
OK, NOT_OK
|
||||
}
|
||||
|
||||
class C {
|
||||
val s: String by E.OK
|
||||
}
|
||||
|
||||
val c = C()
|
||||
|
||||
operator fun E.getValue(thisRef: Any?, property: Any?): String =
|
||||
if (this == E.OK && thisRef == c) "OK" else "Failed"
|
||||
|
||||
fun box(): String = c.s
|
||||
Reference in New Issue
Block a user