This is deprecated according to dmd 64-bit linux, but no error message for Mac or Windows, and exhibits different runtime behavior on Windows to those other platforms, as I found out from my students using it in a current CS2 class.

Is there some reason why assigning to a non-ref foreach variable is permitted at all? Naively, it's a value from the loop's range, but not a variable, and so the compiler could treat it as such and forbid assignment.

Reply via email to