← Back to index
|
Original Bugzilla link
Bug 8783 – ref foreach update of const fixed size arrays in constructor
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-08T10:20:00Z
Last change time
2013-01-29T18:47:03Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2012-10-08T10:20:50Z
This is a spinoff of Issue 6174 struct Foo { int[1] bar; } const Foo[1] foos; static this() { foreach (i; 0 .. foos.length) foos[i].bar[i] = 1; // OK foreach (i, ref f; foos) f.bar[i] = 1; // line 9, Error } void main() {} DMD 2.061alpha gives: temp.d(9): Error: cannot modify const expression f.bar[i]
Comment #1
by k.hara.pg — 2012-12-07T07:35:49Z
https://github.com/D-Programming-Language/dmd/pull/1355
Comment #2
by github-bugzilla — 2012-12-07T08:24:55Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/a0da328e8d4cbdca1f9c983689b637c02d62f0b3
fix Issue 8783 - ref foreach update of const fixed size arrays in constructor
https://github.com/D-Programming-Language/dmd/commit/3dff7653486bb68bbac21de2764cc76c93c259c4
Merge pull request #1355 from 9rnsr/fix8783 Issue 8783 - ref foreach update of const fixed size arrays in constructor
Comment #3
by bearophile_hugs — 2012-12-07T10:00:08Z
Seems fixed.
Comment #4
by k.hara.pg — 2012-12-12T16:52:21Z
To fix bug 9140, this change had to temporary reverted. Sorry.
Comment #5
by k.hara.pg — 2013-01-28T03:47:23Z
New pull request:
https://github.com/D-Programming-Language/dmd/pull/1570
Comment #6
by github-bugzilla — 2013-01-29T16:48:07Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/2bff284fd0e39529c15326d3bce0fce7fb10be32
fix Issue 8783 - ref foreach update of const fixed size arrays in constructor
https://github.com/D-Programming-Language/dmd/commit/e52dfc41fb6e83c13635dc6ac14d3a4ede8d4ac5
Merge pull request #1570 from 9rnsr/fix8783 Issue 8783 - ref foreach update of const fixed size arrays in constructor