@@ -122,16 +122,9 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces {
122122 }
123123
124124 def pickle (macroImplRef : Tree ): Tree = {
125- val macroImpl = macroImplRef.symbol
125+ val MacroImplReference (owner, macroImpl, targs) = macroImplRef
126126 val paramss = macroImpl.paramss
127127
128- // this logic relies on the assumptions that were valid for the old macro prototype
129- // namely that macro implementations can only be defined in top-level classes and modules
130- // with the new prototype that materialized in a SIP, macros need to be statically accessible, which is different
131- // for example, a macro def could be defined in a trait that is implemented by an object
132- // there are some more clever cases when seemingly non-static method ends up being statically accessible
133- // however, the code below doesn't account for these guys, because it'd take a look of time to get it right
134- // for now I leave it as a todo and move along to more the important stuff
135128 // todo. refactor when fixing SI-5498
136129 def className : String = {
137130 def loop (sym : Symbol ): String = sym match {
@@ -143,7 +136,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces {
143136 loop(sym.owner) + separator + sym.javaSimpleName.toString
144137 }
145138
146- loop(macroImpl. owner.enclClass )
139+ loop(owner)
147140 }
148141
149142 def signature : List [Int ] = {
@@ -164,7 +157,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces {
164157 // I just named it "macro", because it's macro-related, but I could as well name it "foobar"
165158 val nucleus = Ident (newTermName(" macro" ))
166159 val wrapped = Apply (nucleus, payload map { case (k, v) => Assign (pickleAtom(k), pickleAtom(v)) })
167- val pickle = gen.mkTypeApply(wrapped, treeInfo.typeArguments(macroImplRef .duplicate))
160+ val pickle = gen.mkTypeApply(wrapped, targs map (_ .duplicate))
168161
169162 // assign NoType to all freshly created AST nodes
170163 // otherwise pickler will choke on tree.tpe being null
0 commit comments