diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index 122d77056ece..4156f8835125 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -401,7 +401,7 @@ trait QuotesAndSplices { override def apply(tp: Type): Type = tp match { case tp: TypeRef => val tp1 = if (tp.typeSymbol.isTypeSplice) tp.dealias else tp - typeBindings.get(tp1.typeSymbol).fold(tp)(_.symbol.typeRef) + mapOver(typeBindings.get(tp1.typeSymbol).fold(tp)(_.symbol.typeRef)) case tp => mapOver(tp) } } diff --git a/tests/pos-macros/i9465.scala b/tests/pos-macros/i9465.scala new file mode 100644 index 000000000000..574429af600c --- /dev/null +++ b/tests/pos-macros/i9465.scala @@ -0,0 +1,12 @@ +import scala.quoted._ + +trait Coll[A] { + type C[X] // must be abstract + def map[B]: C[Any] // needs both the type param and a return type that refers to C +} + +object QuoteTest { + def compile(expr: Expr[Any])(using QuoteContext): Expr[Any] = expr match { + case '{ (??? : Coll[$y]).map[$b] } => ??? + } +}