[JVM_IR] Optimize properties delegated to const val
We can omit `get` call to delegated property and inline constant value directly. If we are not going to do that, we can get a runtime exception because all usages of const property will be inlined and the property itself will be dropped. #KT-63567 Fixed #KT-63580 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_STDLIB
|
||||
|
||||
// FILE: A.java
|
||||
public class A {
|
||||
public static final String OK = "OK";
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
val value: String by A::OK
|
||||
|
||||
fun box(): String {
|
||||
return value
|
||||
}
|
||||
Reference in New Issue
Block a user