In Eclipse, the following line of JavaScript
var a1 = [[1, 2], [3, 4]];
generates warnings:
Type mismatch: cannot convert from Number[] to any Type mismatch: cannot convert from Number[] to any
a
var a2 = [['w', 'x'], ['y', 'z']];
generates:
Type mismatch: cannot convert from String[] to any Type mismatch: cannot convert from String[] to any
and
var a3 = [[1, 2], ['y', 'z']];
generates:
Type mismatch: cannot convert from Number[] to any Type mismatch: cannot convert from String[] to any
However, these lines are fine:
var a4 = [[1, 'x'], [3, 'y']]; var a5 = [[1, 2]]; var a6 = [['x', 'y']];
It seems that the problem is with arrays of arrays when the subarrays contain the same primitive type. However, I don't understand why, and the code seems to be working fine. Can someone explain what bothers Eclipse?