But as I said, that example is bollocks code.
If I saw that in some real code I would take it out back and have it shot.
How should the compiler know that the above is not a valid cast?
And what changes are required in the runtime to make a runtime exception occur at the point of assignment? Presumably every "array[i] = something" will have to have a check the "something" is allowed in the underlying object?
This is still a mental exercise. Do you have a concrete example?
If you don't then maybe you might realise why this is not likely to be dealt with.