Skip to content

Commit 71e9ecd

Browse files
committed
StringContextClass -> Module
1 parent 474ff95 commit 71e9ecd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ class Definitions {
575575

576576
lazy val StringContextType: TypeRef = ctx.requiredClassRef("scala.StringContext")
577577
def StringContextClass(implicit ctx: Context) = StringContextType.symbol.asClass
578+
def StringContextModule(implicit ctx: Context) = StringContextClass.companionClass
578579

579580
lazy val PartialFunctionType: TypeRef = ctx.requiredClassRef("scala.PartialFunction")
580581
def PartialFunctionClass(implicit ctx: Context) = PartialFunctionType.symbol.asClass

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ 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-
val clsSym = ident.symbol.companionClass
25-
if (clsSym.eq(defn.StringContextClass) && strs.forall(_.isInstanceOf[Literal])
24+
if (ident.symbol.eq(defn.StringContextModule) && strs.forall(_.isInstanceOf[Literal])
2625
&& elems.length == strs.length - 1) {
2726
if (fn == nme.raw_) Some(strs, elems)
2827
else if (fn == nme.s) {

0 commit comments

Comments
 (0)