Closed
Description
trait X[R <: Z, Z >: X[R, R]] {
// def foo(x: X[R, R]): Z = x
}
class Z extends X[Z, Z]
Somehow this compiles, even though foo
doesn't. Note that class Z
is not a super type of X[Z, Z]
, which is required by the second type parameter of trait X
.
trait X[R <: Z, Z >: X[R, R] <: X[R, R]] {
// implicitly[Z =:= X[R, R]] // won't compile
}
class Z extends X[Z, Z]