@@ -207,7 +207,10 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
207207 explicitTags.clear()
208208
209209 // Maps type splices to type references of tags e.g., ~t -> some type T$1
210- val map : Map [Type , Type ] = tagsExplicitTypeDefsPairs.map(x => (x._1, x._2.symbol.typeRef)).toMap
210+ val map : Map [Type , Type ] = {
211+ tagsExplicitTypeDefsPairs.map(x => (x._1, x._2.symbol.typeRef)) ++
212+ (itags.map(_._1) zip typeDefs.map(_.symbol.typeRef))
213+ }.toMap
211214 val tMap = new TypeMap () {
212215 override def apply (tp : Type ): Type = map.getOrElse(tp, mapOver(tp))
213216 }
@@ -242,7 +245,7 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
242245 l == level ||
243246 sym.is(Inline ) && sym.owner.is(Macro ) && sym.info.isValueType && l - 1 == level
244247 case None =>
245- true
248+ level == 0
246249 }
247250
248251 /** Issue a "splice outside quote" error unless we ar in the body of an inline method */
@@ -286,12 +289,12 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
286289 if (! isThis) sym.show
287290 else if (sym.is(ModuleClass )) sym.sourceModule.show
288291 else i " ${sym.name}.this "
289- if (! isThis && sym.maybeOwner.isType)
292+ if (! isThis && sym.maybeOwner.isType && ! sym.is( Param ) )
290293 check(sym.owner, sym.owner.thisType, pos)
291294 else if (sym.exists && ! sym.isStaticOwner && ! levelOK(sym))
292295 for (errMsg <- tryHeal(tp, pos))
293296 ctx.error(em """ access to $symStr from wrong staging level:
294- | - the definition is at level ${levelOf(sym)},
297+ | - the definition is at level ${levelOf.getOrElse (sym, 0 )},
295298 | - but the access is at level $level. $errMsg""" , pos)
296299 }
297300
@@ -310,7 +313,8 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
310313 }
311314 case tp : NamedType =>
312315 check(tp.symbol, tp, pos)
313- foldOver(acc, tp)
316+ if (! tp.symbol.is(Param ))
317+ foldOver(acc, tp)
314318 case tp : ThisType =>
315319 check(tp.cls, tp, pos)
316320 foldOver(acc, tp)
0 commit comments