Skip to content

Commit a23ae50

Browse files
Merge pull request #4261 from dotty-staging/optimize/quote-mayChange
Optimize ReifyQuotes#mayChange
2 parents 2f94916 + 2ebf138 commit a23ae50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,8 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
630630
transform(tp)
631631
}
632632

633-
override protected def mayChange(sym: Symbol)(implicit ctx: Context): Boolean = sym.is(Macro)
633+
override protected def mayChange(sym: Symbol)(implicit ctx: Context): Boolean =
634+
ctx.compilationUnit.containsQuotesOrSplices && sym.isTerm && sym.is(Macro)
634635

635636
/** Returns the type of the compiled macro as a lambda: Seq[Any] => Object */
636637
private def macroReturnType(implicit ctx: Context): Type =

0 commit comments

Comments
 (0)