cat > bug.d << CODE
struct S
{
size_t foo()
{
_ary.length += 1;
return _ary.length;
}
int[] _ary;
}
enum len = S().foo();
CODE
dmd -c bug
--------
Happens only if array is a struct field and when
read-assign on length (pre/post-increment or opAssign).
Comment #1 by github-bugzilla — 2012-03-28T16:15:56Z