Inline preevaluated string and primitive only constants in compilation time, don't inline const references in non-annotation context, fix for KT-11025: Don't inline const val in compare instuctions
#KT-11025 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
const val z = 0
|
||||
|
||||
fun a() {
|
||||
val x = z
|
||||
}
|
||||
|
||||
// 1 GETSTATIC NoInlineKt.z : I
|
||||
@@ -0,0 +1,8 @@
|
||||
const val z = 0
|
||||
|
||||
fun a() {
|
||||
if (z == 2) {
|
||||
}
|
||||
}
|
||||
|
||||
// 1 GETSTATIC NoInlineInCmpKt.z : I
|
||||
@@ -0,0 +1,6 @@
|
||||
fun box(): String {
|
||||
return "O" + "K".toString() + 1.toLong()
|
||||
}
|
||||
|
||||
// 1 LDC "OK1"
|
||||
// 1 LDC
|
||||
+1
-1
@@ -9,4 +9,4 @@ fun foo(x : String) : String {
|
||||
return "other"
|
||||
}
|
||||
|
||||
// 1 LOOKUPSWITCH
|
||||
// 0 LOOKUPSWITCH
|
||||
|
||||
Reference in New Issue
Block a user