https://issues.dlang.org/show_bug.cgi?id=9570
--- Comment #5 from Lionello Lunesu <[email protected]> --- (In reply to bearophile_hugs from comment #4) > (In reply to Lionello Lunesu from comment #3) > > https://github.com/D-Programming-Language/dmd/pull/3567 > > Is this supported? > > void main() { > ubyte[256] data; > foreach (ubyte i, ref x; data) > x = i; > } No, the key must be declared const or immutable. Otherwise we need flow analysis to ensure the key doesn't get mutated in the scope. --
