Skip to content

Commit 8ae12f4

Browse files
committed
Use companion class
1 parent 8235acc commit 8ae12f4

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
@@ -21,7 +21,8 @@ class StringInterpolatorOpt extends MiniPhase {
2121
tree match {
2222
case Apply(Select(Apply(Select(ident, nme.apply), List(SeqLiteral(strs, _))), fn),
2323
List(SeqLiteral(elems, _))) =>
24-
if (ident.symbol.eq(defn.StringContextClass) && strs.forall(_.isInstanceOf[Literal])) {
24+
val clsSym = ident.symbol.companionClass
25+
if (clsSym.eq(defn.StringContextClass) && strs.forall(_.isInstanceOf[Literal])) {
2526
if (fn == nme.raw_) Some(strs, elems)
2627
else if (fn == nme.s) {
2728
try {

0 commit comments

Comments
 (0)