https://issues.dlang.org/show_bug.cgi?id=13670
Ketmar Dark <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Ketmar Dark <[email protected]> --- (In reply to Jonathan M Davis from comment #1) > So, essentially, you want to do something like > > a[i] = i++ > > and have that be equivalent to > > i++; > a[i] = i; nope. what i want for dynamic arrays is: tmparr = &a; tmpidx = i*a[0].sizeof; i++; tmparr.ptr[tmpidx] = i; there is nothing that breaks evaluation order in case of dynamic arrays, and with this change they will work exactly the same as static arrays. or at least make compiler emit error on such assignments, so i don't have to track if my variable is dynamic or static array manually. > Regardless, I'd advise that you avoid any code where you mutate a variable > in an expression and then use that same variable elsewhere in the > expression. as i wrote in NG, current behavior with dynamic arrays is plainly wrong. it breaks "the least surprise" principle and requires programmer to manually track variable types. not something i'd expect from "safe and powerful" language. > In any case, AFAIK, your example does not currently count as a bug. ah. so close it, please. --
