Skip empty string entries when generating string template expression

#KT-19738 Fixed Target versions 1.2.50
This commit is contained in:
Dmitry Petrov
2018-03-14 14:15:28 +03:00
parent 22c2d8b563
commit 54cf11fd0a
3 changed files with 13 additions and 1 deletions
@@ -875,7 +875,10 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
constantValue.append(String.valueOf(compileTimeConstant.getValue()));
}
else {
result.add(new StringTemplateEntry.Constant(constantValue.toString()));
String accumulatedConstantValue = constantValue.toString();
if (accumulatedConstantValue.length() > 0) {
result.add(new StringTemplateEntry.Constant(accumulatedConstantValue));
}
constantValue.setLength(0);
result.add(new StringTemplateEntry.Expression(entryExpression));