Add possibility to interpret and fold IrStringConcatenation expression

This commit is contained in:
Ivan Kylchik
2023-02-09 12:29:27 +01:00
committed by Space Team
parent 7cf9dda8dc
commit 63b340651d
77 changed files with 305 additions and 184 deletions
@@ -0,0 +1,16 @@
// TARGET_BACKEND: JVM_IR
// TARGET_BACKEND: NATIVE
// TARGET_BACKEND: JS_IR
// WITH_STDLIB
const val simple = "O${'K'} ${1.toLong() + 2.5}"
const val withInnerConcatenation = "1 ${"2 ${3} ${4} 5"} 6"
const val withNull = "1 ${null}" // but `"1" + null` is invalid
fun box(): String {
if (simple != "OK 3.5") return "Fail 1"
if (withInnerConcatenation != "1 2 3 4 5 6") return "Fail 2"
if (withNull != "1 null") return "Fail 3"
return "OK"
}