Skip to content

Commit

Permalink
Merge pull request #7366 from dotty-staging/fix-#7323
Browse files Browse the repository at this point in the history
Fix #7323: Fix missing PCP check for path dependent type
  • Loading branch information
nicolasstucki committed Oct 4, 2019
2 parents 15cece6 + 609e7d5 commit 736af36
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
// Replace it with a properly encoded type splice. This is the normal for expected for type splices.
tp.prefix.select(tpnme.splice)
case tp: NamedType =>
if (tp.prefix.isInstanceOf[TermRef] && tp.prefix.isStable) tp
else checkSymLevel(tp.symbol, tp, pos) match {
checkSymLevel(tp.symbol, tp, pos) match {
case Some(tpRef) => tpRef.tpe
case _ =>
if (tp.symbol.is(Param)) tp
Expand Down
3 changes: 3 additions & 0 deletions tests/neg/i7323.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
trait Foo { type X }
def f[T](given scala.quoted.Type[T]) = ???
def g(m: Foo) = f[m.X] // error
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 736af36

Please sign in to comment.