@@ -124,7 +124,7 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
124
124
*
125
125
* See `isCaptured`
126
126
*/
127
- val capturers = new mutable.HashMap [Symbol , RefTree => Tree ]
127
+ val capturers = new mutable.HashMap [Symbol , Tree => Tree ]
128
128
}
129
129
130
130
/** The main transformer class
@@ -148,6 +148,9 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
148
148
/** We are in a `~(...)` context that is not shadowed by a nested `'(...)` */
149
149
def inSplice = outer != null && ! inQuote
150
150
151
+ /** We are not in a `~(...)` or a `'(...)` */
152
+ def isRoot = outer == null
153
+
151
154
/** A map from type ref T to expressions of type `quoted.Type[T]`".
152
155
* These will be turned into splices using `addTags` and represent type variables
153
156
* that can be possibly healed.
@@ -295,6 +298,8 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
295
298
else i " ${sym.name}.this "
296
299
if (! isThis && sym.maybeOwner.isType && ! sym.is(Param ))
297
300
check(sym.owner, sym.owner.thisType, pos)
301
+ else if (level == 1 && sym.isType && sym.is(Param ) && sym.owner.is(Macro ) && ! outer.isRoot)
302
+ importedTags(sym.typeRef) = capturers(sym)(ref(sym))
298
303
else if (sym.exists && ! sym.isStaticOwner && ! levelOK(sym))
299
304
for (errMsg <- tryHeal(tp, pos))
300
305
ctx.error(em """ access to $symStr from wrong staging level:
0 commit comments