Kotlin: Add support for string templates

This commit is contained in:
Ian Lynagh
2021-11-01 16:34:26 +00:00
parent 168786ae71
commit 976cc31c7a
3 changed files with 33 additions and 0 deletions

View File

@@ -1419,6 +1419,17 @@ class X {
val exprParent = parent.expr(e, callable)
extractCall(e, callable, exprParent.parent, exprParent.idx)
}
is IrStringConcatenation -> {
val exprParent = parent.expr(e, callable)
val id = tw.getFreshIdLabel<DbStringtemplateexpr>()
val type = useType(e.type)
val locId = tw.getLocation(e)
tw.writeExprs_stringtemplateexpr(id, type.javaResult.id, type.kotlinResult.id, exprParent.parent, exprParent.idx)
tw.writeHasLocation(id, locId)
e.arguments.forEachIndexed { i, a ->
extractExpressionExpr(a, callable, id, i)
}
}
is IrConst<*> -> {
val exprParent = parent.expr(e, callable)
val v = e.value