Skip to content

Commit 5ee64d5

Browse files
committed
Fix #4369: Add regression test
1 parent 9a2d2d1 commit 5ee64d5

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

tests/neg/i4369.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
trait X[R <: Z, Z >: X[R, R]] {
2+
def foo(x: X[R, R]): Z = x // error: Found: X[R, R](x) Required: Z
3+
}
4+
class Z extends X[Z, Z]

tests/neg/i4369b.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
trait X[R <: Z, Z >: X[R, R] <: X[R, R]] {
2+
implicitly[Z =:= X[R, R]] // error: Cannot prove that Z =:= X[R, R]
3+
}
4+
class Z extends X[Z, Z]

tests/neg/i4369c.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trait X { self =>
2+
type R <: Z
3+
type Z >: X { type R = self.R; type Z = self.R }
4+
}
5+
class Foo extends X { type R = Foo; type Z = Foo } // error

0 commit comments

Comments
 (0)