diff --git a/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala b/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala index 263b0040eb24..476248db493a 100644 --- a/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala +++ b/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala @@ -115,7 +115,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages( if body.isTerm then // `quoted.runtime.Expr.quote[T]()` --> `quoted.runtime.Expr.quote[T2]()` val TypeApply(fun, targs) = quote.fun: @unchecked - val targs2 = targs.map(targ => TypeTree(healTypeOfTerm(quote.fun.srcPos)(targ.tpe))) + val targs2 = targs.map(targ => TypeTree(healType(quote.fun.srcPos)(targ.tpe))) cpy.Apply(quote)(cpy.TypeApply(quote.fun)(fun, targs2), body2 :: Nil) else val quotes = quote.args.mapConserve(transform) @@ -209,8 +209,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages( case tp: ThisType if level != -1 && level != levelOf(tp.cls) => levelError(tp.cls, tp, pos) case tp: AnnotatedType => - val newAnnotTree = transform(tp.annot.tree) - derivedAnnotatedType(tp, apply(tp.parent), tp.annot.derivedAnnotation(newAnnotTree)) + derivedAnnotatedType(tp, apply(tp.parent), tp.annot) case _ => mapOver(tp) } diff --git a/tests/pos-macros/i15709.scala b/tests/pos-macros/i15709.scala new file mode 100644 index 000000000000..78f1e05735b1 --- /dev/null +++ b/tests/pos-macros/i15709.scala @@ -0,0 +1,4 @@ +import quoted.* + +inline def foo(s: Singleton): Unit = ${ fooImpl('s) } +def fooImpl(s: Expr[Singleton])(using Quotes) = '{} \ No newline at end of file