diff --git a/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala b/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala index c7293330d7e2..127300c6baa6 100644 --- a/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala +++ b/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala @@ -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 diff --git a/tests/neg/i7323.scala b/tests/neg/i7323.scala new file mode 100644 index 000000000000..4fdaefc7f14d --- /dev/null +++ b/tests/neg/i7323.scala @@ -0,0 +1,3 @@ +trait Foo { type X } +def f[T](given scala.quoted.Type[T]) = ??? +def g(m: Foo) = f[m.X] // error \ No newline at end of file diff --git a/tests/pos/i7048.scala b/tests/pending/pos/i7048.scala similarity index 100% rename from tests/pos/i7048.scala rename to tests/pending/pos/i7048.scala diff --git a/tests/run-macros/i7048/Lib_1.scala b/tests/pending/run-macros/i7048/Lib_1.scala similarity index 100% rename from tests/run-macros/i7048/Lib_1.scala rename to tests/pending/run-macros/i7048/Lib_1.scala diff --git a/tests/run-macros/i7048/Test_2.scala b/tests/pending/run-macros/i7048/Test_2.scala similarity index 100% rename from tests/run-macros/i7048/Test_2.scala rename to tests/pending/run-macros/i7048/Test_2.scala