From f6d487403d9cf74fbd1ab4db56aef26b80e9376e Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 6 Aug 2020 11:43:09 +0200 Subject: [PATCH] Fix #9465: Add missing recursion --- .../dotty/tools/dotc/typer/QuotesAndSplices.scala | 2 +- tests/pos-macros/i9465.scala | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/pos-macros/i9465.scala 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] } => ??? + } +}