Never Type For Arrays #6387
Labels
audit-report
Related to the audit report
bug
Something isn't working
P: low
team:compiler
Compiler Team
CS-FSSA-021
Empty arrays are assigned the never type. Never type is treated as a subtype of all types. This means
that a never array should be assignable to an empty array of any other type. Moroever, if we assign an
empty array to a type-ascribed variable, the type of this variable should be its ascription. This is not true
in the following example.
The never type in arrays is more problematic considering the following case which also compiles:
As one would expect x to preserve its ascription assigning x to y should fail since the never type is a
subtype of the [u32;0].
The text was updated successfully, but these errors were encountered: