diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Macros.scala | 8 | ||||
-rw-r--r-- | test/files/codelib/code.jar.desired.sha1 | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala index ed249796a8..470f3e7117 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala @@ -20,15 +20,12 @@ trait Macros { self: Analyzer => macroArgs(fn) :+ args case TypeApply(fn, args) => macroArgs(fn) :+ args - case Select(qual, name) if !isStaticMacro(tree.symbol) => + case Select(qual, name) => List(List(qual)) case _ => List(List()) } - private def isStaticMacro(mac: Symbol): Boolean = - mac.owner.isModuleClass - /** * The definition of the method implementing a macro. Example: * Say we have in a class C @@ -46,7 +43,6 @@ trait Macros { self: Analyzer => * expr * } * - * If `foo` is declared in an object, the second parameter list is () instead of (_this: _context.Tree). * If macro has no type arguments, the third parameter list is omitted (it's not empty, but omitted altogether). * * To find out the desugared representation of your particular macro, compile it with -Ymacro-debug. @@ -58,7 +54,7 @@ trait Macros { self: Analyzer => def globSelect(name: Name) = Select(Ident(nme.macroContext), name) def globTree = globSelect(tpnme.Tree) def globTypeTree = globSelect(tpnme.TypeTree) - val thisParamSec = if (isStaticMacro(mdef.symbol)) List() else List(paramDef(nme.macroThis, globTree)) + val thisParamSec = List(paramDef(newTermName(nme.macroThis), globTree)) def tparamInMacro(tdef: TypeDef) = paramDef(tdef.name.toTermName, globTypeTree) def vparamInMacro(vdef: ValDef): ValDef = paramDef(vdef.name, vdef.tpt match { case tpt @ AppliedTypeTree(hk, _) if treeInfo.isRepeatedParamType(tpt) => AppliedTypeTree(hk, List(globTree)) diff --git a/test/files/codelib/code.jar.desired.sha1 b/test/files/codelib/code.jar.desired.sha1 index 5e7acf3b90..dbf19cafd7 100644 --- a/test/files/codelib/code.jar.desired.sha1 +++ b/test/files/codelib/code.jar.desired.sha1 @@ -1 +1 @@ -5880dd44ee9fedec44fed3f223842e42d8a63959 ?code.jar +e25f1daf9010b9dc6038ae7069fc9d0f7d48a53b ?code.jar |