File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,15 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
124124 val targs2 = targs.map(targ => TypeTree (healTypeOfTerm(quote.fun.srcPos)(targ.tpe)))
125125 cpy.Apply (quote)(cpy.TypeApply (quote.fun)(fun, targs2), body2 :: Nil )
126126 else
127+ val quotes = quote.args.mapConserve(transform)
127128 body.tpe match
128129 case tp @ TypeRef (x : TermRef , _) if tp.symbol == defn.QuotedType_splice =>
129130 // Optimization: `quoted.Type.of[x.Underlying](quotes)` --> `x`
130131 ref(x)
131132 case _ =>
132133 // `quoted.Type.of[<body>](quotes)` --> `quoted.Type.of[<body2>](quotes)`
133134 val TypeApply (fun, _) = quote.fun
134- cpy.Apply (quote)(cpy.TypeApply (quote.fun)(fun, body2 :: Nil ), quote.args )
135+ cpy.Apply (quote)(cpy.TypeApply (quote.fun)(fun, body2 :: Nil ), quotes )
135136 }
136137
137138 /** Transform splice
Original file line number Diff line number Diff line change 1+ import scala .quoted .*
2+
3+ def impl1 [A ](using t : Type [A ])(using q : Quotes ) =
4+ ' { Type .of[A ] ; ??? } // error
5+
6+ def impl2 [A ](using t : Type [A ])(using q : Quotes ) =
7+ ' { Type .of[A ](using q) ; ??? } // error
You can’t perform that action at this time.
0 commit comments