Optimize ir interpretation of Enum.name
There is no need to create honest object in case of such simple calculation. Furthermore, it can be harmful if enum class has non-constant initializer or property. #KT-53480 Fixed
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// FILE: J.java
|
||||
public class J {
|
||||
public static int f() { return 0; }
|
||||
}
|
||||
|
||||
// FILE: Main.kt
|
||||
enum class A {
|
||||
E;
|
||||
val x = J.f()
|
||||
}
|
||||
|
||||
const val name = A.E.name
|
||||
Reference in New Issue
Block a user