|
I threw this in with the previous commit behind -Ybreak-cycles, but
this one is much less sketchy. Explanation: have to handle f-bounds
more deftly. Namers forces lower bounds to prevent recursion in
that direction, but a light touch is required to handle these two
situations differently:
// This is a cyclic type parameter - an error is correct
class A[T <: Comparable[_ <: T]]
// This is not cyclic - it flips the arrow
class B[T <: Comparable[_ >: T]]
Long have I been haunted by the knowledge that you can
write class B in java, but not in scala:
public class B<T extends Comparable<? super T>> {}
It's over! We've achieved parity with java.
|