Skip to content

Commit 6cf9c66

Browse files
committed
Typecheck macros as if they were in a quoted context
A macro is intended to be used in a quoted context, so should be checked in such a context as well.
1 parent b50e376 commit 6cf9c66

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ class ReifyQuotes extends MacroTransform {
330330
case _: Import =>
331331
tree
332332
case tree: DefDef if tree.symbol.is(Macro) =>
333+
val tree1 = nested(isQuote = true).transform(tree)
334+
// check macro code as it if appeared in a quoted context
333335
cpy.DefDef(tree)(rhs = EmptyTree)
334336
case _ =>
335337
markDef(tree)

0 commit comments

Comments
 (0)