Open
Description
Reproduction steps
Scala version: 2.13.12
Java interfaces:
interface Parent {
default Object bug() {
return "Hello world";
}
}
interface Child extends Parent {
@Override
String bug();
}
Problem
Do compile in Java:
public class MainJava {
public static void main(String[] args) {
Child child = null;
String value = child.bug();
}
}
Do not compile in Scala:
object MainScala {
def main(args: Array[String]): Unit = {
val child: Child = null
val value: String = child.bug()
}
}
Result:
[error] type mismatch;
[error] found : Object
[error] required: String
[error] val value: String = child.bug()
Java and Scala implementation should have the same behavior.