Closed
Description
reproduction steps
using Scala 2.13.6,
Java:
public interface A {
A[] getArray();
}
public interface B extends A {
@Override
B[] getArray();
}
Scala:
trait Test extends B
problem
When compiling the scala code the compiler gives:
incompatible type in overriding
def getArray(): Array[A] (defined in trait A)
with def getArray(): Array[B] (defined in trait B);
found : (): Array[B]
required: (): Array[A]
trait Test extends B
This makes it impossible to inherit B
.