I am using a Java library in my Scala project which has an interface that looks like this:
public interface A extends Comparable {
String getSomething();
}
Note how the library implementation does not specify any specific type for Java's Comparable<T>
interface.
In my Scala code I want to create an instance of A like so:
object AFactory {
def getA: A = new A {
override def getSomething: String = "test"
override def compareTo(o: ???): Int = -1
}
}
Unfortunately, I am not sure what type to specify for ???
. Does anyone know how can I implement this interface and get it to compile?