I'm writing a framework. The interfaces are written and compiled in Java code. The client uses Scala and those interfaces. Here is an example of the interface.
public interface Context {
MyComponent<? extends File> getComponent();
}
Now my scala code uses the interface as follows.
val component = context.getComponent();
println(calculate(component));
def calculate( component: MyComponent[File] ): Unit = ???
Scala compiler is throwing errors at line 2 for println(calculate(component))
. The error is: Type mismatched, expected: MyComponent[File], actual: MyComponent[_ <: File].