Skip to content

Commit 2ebf138

Browse files
committed
Optimize ReifyQuotes#mayChange
1 parent 7d01268 commit 2ebf138

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
@@ -620,7 +620,8 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
620620
transform(tp)
621621
}
622622

623-
override protected def mayChange(sym: Symbol)(implicit ctx: Context): Boolean = sym.is(Macro)
623+
override protected def mayChange(sym: Symbol)(implicit ctx: Context): Boolean =
624+
ctx.compilationUnit.containsQuotesOrSplices && sym.isTerm && sym.is(Macro)
624625

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

0 commit comments

Comments
 (0)