From 0e2041a72359e84c73010747c9d89ce578b9726c Mon Sep 17 00:00:00 2001 From: Hamza Remmal <56235032+hamzaremmal@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:13:16 +0100 Subject: [PATCH] Add documentation for MacroAnnotations::enterMissingSymbols --- .../src/dotty/tools/dotc/transform/MacroAnnotations.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala b/compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala index 6f0e59a52213..5e0c0bc0a1c0 100644 --- a/compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala +++ b/compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala @@ -134,10 +134,12 @@ class MacroAnnotations(phase: IdentityDenotTransformer): else if annotated.isClass && annotated.owner.is(Package) /*&& !sym.isClass*/ then report.error(i"macro annotation can not add top-level ${sym.showKind}. $annot tried to add $sym.", annot.tree) + /** + * Enter the symbols generated by MacroAnnotations + */ private def enterMissingSymbols(tree: DefTree)(using Context) = new TreeTraverser { def traverse(tree: tpd.Tree)(using Context): Unit = tree match case tdef @ TypeDef(_, template: Template) => - //for tree <- template.constr :: template.body do val isSymbolInDecls = tdef.symbol.asClass.info.decls.toList.toSet for tree <- template.body do if tree.symbol.owner != tdef.symbol then