diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/IrStringConcatenation.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/IrStringConcatenation.kt index 3d5d2bba266..810b00f49ce 100644 --- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/IrStringConcatenation.kt +++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/IrStringConcatenation.kt @@ -13,7 +13,16 @@ import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor /** - * A leaf IR tree element. + * Represents a string template expression. + * + * For example, the value of `template` in the following code: + * ```kotlin + * val i = 10 + * val template = "i = $i" + * ``` + * will be represented by [IrStringConcatenation] with the following list of [arguments]: + * - [IrConst] whose `value` is `"i = "` + * - [IrGetValue] whose `symbol` will be that of the `i` variable. * * Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.stringConcatenation] */ diff --git a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt index eec6fbc9aa4..32b6c59477a 100644 --- a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt +++ b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt @@ -1102,6 +1102,19 @@ object IrTree : AbstractTreeBuilder() { val stringConcatenation: Element by element(Expression) { parent(expression) + kDoc = """ + Represents a string template expression. + + For example, the value of `template` in the following code: + ```kotlin + val i = 10 + val template = "i = ${'$'}i" + ``` + will be represented by [${typeName}] with the following list of [arguments]: + - [${const.typeName}] whose `value` is `"i = "` + - [${getValue.typeName}] whose `symbol` will be that of the `i` variable. + """.trimIndent() + +listField("arguments", expression, mutability = MutableList) } val suspensionPoint: Element by element(Expression) {