mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 00:21:32 +00:00
JVM_IR: fold constant string concatenations
This commit is contained in:
9
compiler/testData/codegen/bytecodeText/stringOperations/partiallyConstConcat.kt
vendored
Normal file
9
compiler/testData/codegen/bytecodeText/stringOperations/partiallyConstConcat.kt
vendored
Normal 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"
|
||||
Reference in New Issue
Block a user