Open uhoefel opened 1 year ago
This works in both javac and ecj:
List<Class<? extends Object[]>> list = List.of(double[][].class, Long[][].class);
Class<Object[]> x = foo(list);
This, too, fails in ecj only:
var list = List.of(double[][].class, Long[][].class);
Class<Object[]> x = foo(list);
saying:
Class<Object[]> x = foo(list);
^^^^^^^^^
Type mismatch: cannot convert from Class<Object & Serializable & Cloneable> to Class<Object[]>
The difference cannot be observed, when removing one array dimension in every type involved:
static void z() {
var list = List.of(double[].class, Long[].class);
Class<Object> x = foo(list);
}
Given a method like this:
with jshell I can do this:
while with eclipse I get this:
Note that for
double[][]
-->Double[][]
it correctly infersNumber[][]
.