why static array can be reassigned with new allocation?

mw mingwu at gmail.com
Sat Oct 15 20:05:25 UTC 2022


On Saturday, 15 October 2022 at 19:58:12 UTC, rassoc wrote:
>     a = b;     // Error: mismatched array lengths, 3 and 5
>     a[] = b[]; // Error: mismatched array lengths, 3 and 5

This is what I'm against.

currently these two statements have the same semantics (content 
assignment).

While the 1st statement should just be var assignment, which does 
NOT need to check length at all, the error message should be 
"Error: static array cannot be re-assigned".




More information about the Digitalmars-d mailing list