Skip to content

Commit ad26554

Browse files
committed
Make InlineCalls an object
1 parent 976e095 commit ad26554

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
443443
else if (enclosingInlineds.nonEmpty) { // level 0 in an inlined call
444444
val spliceCtx = ctx.outer // drop the last `inlineContext`
445445
val pos: SourcePosition = Decorators.sourcePos(enclosingInlineds.head.pos)(spliceCtx)
446-
val splicedTree = new InlineCalls().transform(splice.qualifier) // inline calls that where inlined at level -1
446+
val splicedTree = InlineCalls.transform(splice.qualifier) // inline calls that where inlined at level -1
447447
val evaluatedSplice = Splicer.splice(splicedTree, pos, macroClassLoader)(spliceCtx).withPos(splice.pos)
448448
if (ctx.reporter.hasErrors) splice else transform(evaluatedSplice)
449449
}
@@ -678,7 +678,7 @@ object ReifyQuotes {
678678
}
679679

680680
/** β-reduce all calls to inline methods and preform constant folding */
681-
class InlineCalls extends TreeMap {
681+
object InlineCalls extends TreeMap {
682682
override def transform(tree: Tree)(implicit ctx: Context): Tree = tree match {
683683
case tree if isInlineCall(tree) && !ctx.reporter.hasErrors && !ctx.settings.YnoInline.value =>
684684
val tree2 = super.transform(tree) // transform arguments before inlining (inline arguments and constant fold arguments)

0 commit comments

Comments
 (0)