From f783d0b16b41641b07ca76c03ad2f25a80ff8f2b Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Mon, 13 Aug 2012 21:04:27 +0200 Subject: accommodated the feedback for the pull request For the discussion see: https://github.com/scala/scala/pull/1101 --- src/compiler/scala/tools/nsc/typechecker/Namers.scala | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index efb96b173c..92d0d4e228 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -988,6 +988,15 @@ trait Namers extends MethodSynthesis { // (either "macro ???" as they used to or just "???" to maximally simplify their compilation) if (fastTrack contains ddef.symbol) ddef.symbol setFlag MACRO + // macro defs need to be typechecked in advance + // because @macroImpl annotation only gets assigned during typechecking + // otherwise macro defs wouldn't be able to robustly coexist with their clients + // because a client could be typechecked before a macro def that it uses + if (ddef.symbol.isTermMacro) { + val pt = resultPt.substSym(tparamSyms, tparams map (_.symbol)) + typer.computeMacroDefType(ddef, pt) + } + thisMethodType({ val rt = ( if (!tpt.isEmpty) { -- cgit v1.2.3