Skip to content

Commit

Permalink
Backport "Fix TermRef prefixes not having their type healed" to LTS (#…
Browse files Browse the repository at this point in the history
…21038)

Backports #20102 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jul 5, 2024
2 parents ed81e34 + 370f791 commit b566cb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/staging/HealType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 _ =>
Expand Down
7 changes: 7 additions & 0 deletions tests/pos-macros/i19767.scala
Original file line number Diff line number Diff line change
@@ -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) }

0 comments on commit b566cb4

Please sign in to comment.