@@ -667,29 +667,36 @@ trait Implicits { self: Typer =>
667667 EmptyTree
668668 }
669669
670- def synthesizedTypeTag (formal : Type ): Tree = formal.argInfos match {
671- case arg :: Nil if ! arg.typeSymbol.is(Param ) =>
672- object bindFreeVars extends TypeMap {
673- var ok = true
674- def apply (t : Type ) = t match {
675- case t @ TypeRef (NoPrefix , _) =>
676- inferImplicit(defn.QuotedTypeType .appliedTo(t), EmptyTree , span) match {
677- case SearchSuccess (tag, _, _) if tag.tpe.isStable =>
678- tag.tpe.select(defn.QuotedType_splice )
679- case _ =>
680- ok = false
681- t
682- }
683- case _ => t
670+ def synthesizedTypeTag (formal : Type ): Tree = {
671+ def quotedType (t : Type ) = {
672+ if (StagingContext .level == 0 )
673+ ctx.compilationUnit.needsStaging = true // We will need to run ReifyQuotes
674+ ref(defn.InternalQuoted_typeQuote ).appliedToType(t)
675+ }
676+ formal.argInfos match {
677+ case arg :: Nil if ! arg.typeSymbol.is(Param ) =>
678+ object bindFreeVars extends TypeMap {
679+ var ok = true
680+ def apply (t : Type ) = t match {
681+ case t @ TypeRef (NoPrefix , _) =>
682+ inferImplicit(defn.QuotedTypeType .appliedTo(t), EmptyTree , span) match {
683+ case SearchSuccess (tag, _, _) if tag.tpe.isStable =>
684+ tag.tpe.select(defn.QuotedType_splice )
685+ case _ =>
686+ ok = false
687+ t
688+ }
689+ case _ => t
690+ }
684691 }
685- }
686- val tag = bindFreeVars(arg )
687- if (bindFreeVars.ok) ref(defn. InternalQuoted_typeQuote ).appliedToType(tag)
688- else EmptyTree
689- case arg :: Nil if ctx.inInlineMethod =>
690- ref(defn. InternalQuoted_typeQuote ).appliedToType(arg)
691- case _ =>
692- EmptyTree
692+ val tag = bindFreeVars(arg)
693+ if ( bindFreeVars.ok) quotedType(tag )
694+ else EmptyTree
695+ case arg :: Nil if ctx.inInlineMethod =>
696+ quotedType(arg)
697+ case _ =>
698+ EmptyTree
699+ }
693700 }
694701
695702 def synthesizedTastyContext (formal : Type ): Tree =
0 commit comments