JVM_IR: fold constant string concatenations

This commit is contained in:
pyos
2019-04-15 14:25:35 +02:00
committed by max-kammerer
parent 1bc4a2eff9
commit 5b595b58b2
12 changed files with 81 additions and 8 deletions

View File

@@ -0,0 +1,9 @@
// IGNORE_BACKEND: JVM
fun foo(a: String, b: String) {
val s = a + "1" + "2" + 3 + 4L + b + 5.0 + 6F + '7'
val c = "$a${"1"}2${3}${4L}$b${5.0}${6F}${'7'}"
}
// 2 NEW java/lang/StringBuilder
// 2 LDC "1234"
// 2 LDC "5.06.07"