I need to extend a Java class (from a library) of the following type:
public class A<T extends Comparable<? super T>> {
}
I tried to implement the extending Scala class as:
class B[T <: Comparable[_ >: T]] extends A[T] {
}
Unfortunately, this Scala class does not compile with Scala 2.12.1:
Error:(4, 25) illegal cyclic reference involving type T
class B[T <: Comparable[_ >: T]] extends A[T] {
How can I solve this problem?