https://issues.dlang.org/show_bug.cgi?id=12488
Andrej Mitrovic <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Andrej Mitrovic <[email protected]> --- I don't think this makes any sense. If we were forced to either write auto or ref, then yeah this would actually save us from some bugs, e.g. iterating over a struct array by value (a very common bug IMHO): ----- struct S { int x; } void main() { S[] arr; arr.length = 2; foreach (s; arr) s.x = 10; // fails assert(arr == [S(10), S(10)]); } ----- In this case if we were force to use 'auto' or 'ref' then this bug would be easier to catch. But adding support for 'auto' without requiring a change will do us no good. People will start questioning "why is there an auto if it doesn't do anything", and it's always a bad idea to have two syntaxes that do the exact same thing. It will only cause confusion. --
