Mike Schilling <> wrote:
> Andreas Leitgeb wrote:
>> PS: I haven't tried "new T[...]", myself. I believe, that it
>> *could* theoretically work consistently, but thats moot, if
>> it isn't allowed in reality.
> It would cause problems, because the following would be legal code:
> T[] arr = new T[20]; // Not legal now, but we're assuming
> Object[] oarr = arr; // Legal in general, since we know that
> // T extends Object
> arr[0] = new Object(); // compile-time legal, and since the "real"
> // row type of the Array is Object, legal
You need of course "oarr[0]" for the assignment, but the argument
is then sound. I admit defeat of that former belief
> at run time too
> T t = arr[0]; // Uh-oh.