3 ms·
> The array type seems completely tractable and may be able to be caught by the compiler. This isn't an error, it was a design decision: https://en.wikipedia.
by krona 10y ago
> The array type seems completely tractable and may be able to be caught by the compiler.
This isn't an error, it was a design decision: https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)#Covariant_arrays_in_Java_and_C.23 https://en.wikipedia.org/wiki/Covariance_and_contravariance_...
You could call it bad design, but fixing it would (imo) just make Java even worse than it already is.
- dvt 10y agoMy point had nothing to do with the merits of covariant types, just tractability. It seems that the array's type is tractable so the compiler should (at least) give a warning.