Skip to content

Commit 736af36

Browse files
Merge pull request #7366 from dotty-staging/fix-#7323
Fix #7323: Fix missing PCP check for path dependent type
2 parents 15cece6 + 609e7d5 commit 736af36

File tree

5 files changed

+4
-2
lines changed

5 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
119119
// Replace it with a properly encoded type splice. This is the normal for expected for type splices.
120120
tp.prefix.select(tpnme.splice)
121121
case tp: NamedType =>
122-
if (tp.prefix.isInstanceOf[TermRef] && tp.prefix.isStable) tp
123-
else checkSymLevel(tp.symbol, tp, pos) match {
122+
checkSymLevel(tp.symbol, tp, pos) match {
124123
case Some(tpRef) => tpRef.tpe
125124
case _ =>
126125
if (tp.symbol.is(Param)) tp

tests/neg/i7323.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait Foo { type X }
2+
def f[T](given scala.quoted.Type[T]) = ???
3+
def g(m: Foo) = f[m.X] // error
File renamed without changes.

0 commit comments

Comments
 (0)