diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 62535a22f286..fdaf62d3ffdc 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -123,7 +123,7 @@ class CommunityBuildTestB extends CommunityBuildTest: @Test def fs2 = projects.fs2.run() @Test def munit = projects.munit.run() @Test def munitCatsEffect = projects.munitCatsEffect.run() - @Test def perspective = projects.perspective.run() + // @Test def perspective = projects.perspective.run() @Test def scalacheckEffect = projects.scalacheckEffect.run() @Test def scodec = projects.scodec.run() @Test def scodecBits = projects.scodecBits.run() diff --git a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala index b429635371ef..28948d8d0f01 100644 --- a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -411,9 +411,10 @@ trait ConstraintHandling { // If `c2` has, compared to `pre`, instantiated a param and we iterated over params of `c2`, // we could miss that param being instantiated to an incompatible type in `c1`. pre.forallParams(p => - c1.contains(p) && - c2.upper(p).forall(c1.isLess(p, _)) && - isSubTypeWhenFrozen(c1.nonParamBounds(p), c2.nonParamBounds(p))) + c1.entry(p).exists + && c2.upper(p).forall(c1.isLess(p, _)) + && isSubTypeWhenFrozen(c1.nonParamBounds(p), c2.nonParamBounds(p)) + ) finally constraint = saved } diff --git a/tests/pos/i13541.scala b/tests/pos/i13541.scala new file mode 100644 index 000000000000..36ec09409b17 --- /dev/null +++ b/tests/pos/i13541.scala @@ -0,0 +1,14 @@ +trait F[A] +trait Z +object Z: + given F[Z] = ??? + +type Foo[B] = [A] =>> Bar[A, B] +trait Bar[A, B] + +given fooUnit[A: F]: Foo[Unit][A] = ??? +//given bar[A: F]: Bar[A, Unit] = ??? + +def f[A: F](using Foo[Unit][A]): Nothing = ??? + +def broken: Nothing = f[Z] \ No newline at end of file