Skip to content

Commit b566cb4

Browse files
Backport "Fix TermRef prefixes not having their type healed" to LTS (#21038)
Backports #20102 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents ed81e34 + 370f791 commit b566cb4

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)