Skip to content

Commit ecab729

Browse files
committed
fix test
1 parent 8ae12f4 commit ecab729

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class StringInterpolatorOpt extends MiniPhase {
2222
case Apply(Select(Apply(Select(ident, nme.apply), List(SeqLiteral(strs, _))), fn),
2323
List(SeqLiteral(elems, _))) =>
2424
val clsSym = ident.symbol.companionClass
25-
if (clsSym.eq(defn.StringContextClass) && strs.forall(_.isInstanceOf[Literal])) {
25+
if (clsSym.eq(defn.StringContextClass) && strs.forall(_.isInstanceOf[Literal])
26+
&& elems.length == strs.length - 1) {
2627
if (fn == nme.raw_) Some(strs, elems)
2728
else if (fn == nme.s) {
2829
try {

0 commit comments

Comments
 (0)