Raw FIR: introduce string concatenation call

This removes some 'plus' calls to be resolved
This commit is contained in:
Mikhail Glukhikh
2019-04-16 11:29:59 +03:00
parent 8d2acd790d
commit 77e83dd8cf
15 changed files with 107 additions and 26 deletions
@@ -304,14 +304,13 @@ internal fun Array<KtStringTemplateEntry>.toInterpolatingCall(
}
result = when {
result == null -> nextArgument
callCreated && result is FirFunctionCallImpl -> result.apply {
callCreated && result is FirStringConcatenationCallImpl -> result.apply {
arguments += nextArgument
}
else -> {
callCreated = true
FirFunctionCallImpl(session, base).apply {
calleeReference = FirSimpleNamedReference(session, base, OperatorNameConventions.PLUS)
explicitReceiver = result
FirStringConcatenationCallImpl(session, base).apply {
arguments += result!!
arguments += nextArgument
}
}
@@ -43,7 +43,7 @@ FILE: for.kt
lval <destruct>: <implicit> = <iterator>#.next#()
lval x: <implicit> = <destruct>#.component1()
lval y: <implicit> = <destruct>#.component2()
println#(String(x = ).plus#(x#, String( y = ), y#))
println#(<strcat>(String(x = ), x#, String( y = ), y#))
}
}