Instead of letting the program attempts to compile, the verifier should fail it.
Also note that this code is taken from the documentation:
Caveat: The type of the array created by new T[n] is array. A mistake that is simple to make and that can lead to befuddlement is to write array instead of T after new. For example, consider the following:
var a := new array<T>;
...
The first statement allocates an array of type array, but of unknown length.
verifies. However, it results in a compilation error in every backend.
C#:
Java:
JS:
Go:
Instead of letting the program attempts to compile, the verifier should fail it.
Also note that this code is taken from the documentation:
which misleadingly sounds like the code is fine.