File tree 1 file changed +4
-1
lines changed
compiler/src/dotty/tools/dotc/transform
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
103
103
if (ctx.property(InAnnotation ).isDefined)
104
104
report.error(" Cannot have a quote in an annotation" , quote.srcPos)
105
105
106
+ val stripAnnotsDeep : TypeMap = new TypeMap :
107
+ def apply (tp : Type ): Type = mapOver(tp.stripAnnots)
108
+
106
109
val contextWithQuote =
107
110
if level == 0 then contextWithQuoteTypeTags(taggedTypes)(using quoteContext)
108
111
else quoteContext
@@ -115,7 +118,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
115
118
if body.isTerm then
116
119
// `quoted.runtime.Expr.quote[T](<body>)` --> `quoted.runtime.Expr.quote[T2](<body2>)`
117
120
val TypeApply (fun, targs) = quote.fun: @ unchecked
118
- val targs2 = targs.map(targ => TypeTree (healTypeOfTerm(quote.fun.srcPos)(targ.tpe)))
121
+ val targs2 = targs.map(targ => TypeTree (healTypeOfTerm(quote.fun.srcPos)(stripAnnotsDeep( targ.tpe) )))
119
122
cpy.Apply (quote)(cpy.TypeApply (quote.fun)(fun, targs2), body2 :: Nil )
120
123
else
121
124
val quotes = quote.args.mapConserve(transform)
You can’t perform that action at this time.
0 commit comments