Hi,
I'm trying to declare a method in an abstract class which receives an Array of generic type T. As such:
abstract class Circle[-T] extends Shape[T] {
def draw(points: Array[T]): Unit
}
The problem I'm getting is that Scala compiler complaints with:
contravariant type T occurs in invariant position in type Array[T] of value points
So, is there anyway to solve this besides the following?
def draw[U <: T](points: Array[U]): Unit
As a note, I also need to extend this class in Java.