Skip to content

Commit 370f791

Browse files
jchybWojciechMazur
authored andcommitted
Fix TermRef prefixes not having their type healed
[Cherry-picked 8b3dadb]
1 parent d02a03f commit 370f791

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

compiler/src/dotty/tools/dotc/staging/HealType.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {
3535
case tp: TermRef =>
3636
val inconsistentRoot = levelInconsistentRootOfPath(tp)
3737
if inconsistentRoot.exists then levelError(inconsistentRoot, tp, pos)
38-
else tp
38+
else mapOver(tp)
3939
case tp: AnnotatedType =>
4040
derivedAnnotatedType(tp, apply(tp.parent), tp.annot)
4141
case _ =>

tests/pos-macros/i19767.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import scala.quoted.*
2+
3+
class ICons[K <: Singleton](val key: K)
4+
5+
def filterX(using Quotes): Unit =
6+
(??? : Expr[Any]) match
7+
case '{ $y : ICons[k1] } => '{ ICons($y.key) }

0 commit comments

Comments
 (0)