diff --git a/compiler/src/dotty/tools/dotc/staging/HealType.scala b/compiler/src/dotty/tools/dotc/staging/HealType.scala index 08e1e91b0bad..5a26803c8137 100644 --- a/compiler/src/dotty/tools/dotc/staging/HealType.scala +++ b/compiler/src/dotty/tools/dotc/staging/HealType.scala @@ -35,7 +35,7 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap { case tp: TermRef => val inconsistentRoot = levelInconsistentRootOfPath(tp) if inconsistentRoot.exists then levelError(inconsistentRoot, tp, pos) - else tp + else mapOver(tp) case tp: AnnotatedType => derivedAnnotatedType(tp, apply(tp.parent), tp.annot) case _ => diff --git a/tests/pos-macros/i19767.scala b/tests/pos-macros/i19767.scala new file mode 100644 index 000000000000..2fb655b58a1b --- /dev/null +++ b/tests/pos-macros/i19767.scala @@ -0,0 +1,7 @@ +import scala.quoted.* + +class ICons[K <: Singleton](val key: K) + +def filterX(using Quotes): Unit = + (??? : Expr[Any]) match + case '{ $y : ICons[k1] } => '{ ICons($y.key) } \ No newline at end of file