Add possibility to interpret and fold IrStringConcatenation expression
This commit is contained in:
+16
@@ -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"
|
||||
}
|
||||
Vendored
+1
-2
@@ -104,8 +104,7 @@ FILE fqName:<root> fileName:/recordWithCompanion.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Tag'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Tag("
|
||||
CONST String type=kotlin.String value="id="
|
||||
CONST String type=kotlin.String value="Tag(id="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Tag declared in <root>.Tag.toString' type=<root>.Tag origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
|
||||
Reference in New Issue
Block a user