Thread overview
[Issue 8783] New: ref foreach update of const fixed size arrays in constructor
Dec 07, 2012
Kenji Hara
Dec 13, 2012
Kenji Hara
Jan 28, 2013
Kenji Hara
Jan 30, 2013
Kenji Hara
October 08, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8783

           Summary: ref foreach update of const fixed size arrays in
                    constructor
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2012-10-08 10:20:50 PDT ---
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]

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8783


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-12-07 07:35:49 PST ---
https://github.com/D-Programming-Language/dmd/pull/1355

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8783



--- Comment #2 from github-bugzilla@puremagic.com 2012-12-07 08:24:55 PST ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8783


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #3 from bearophile_hugs@eml.cc 2012-12-07 10:00:08 PST ---
Seems fixed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 13, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8783


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


--- Comment #4 from Kenji Hara <k.hara.pg@gmail.com> 2012-12-12 16:52:21 PST ---
To fix bug 9140, this change had to temporary reverted. Sorry.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 28, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8783



--- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> 2013-01-28 03:47:23 PST ---
New pull request: https://github.com/D-Programming-Language/dmd/pull/1570

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 30, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8783



--- Comment #6 from github-bugzilla@puremagic.com 2013-01-29 16:48:07 PST ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 30, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8783


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
           Platform|x86                         |All
         Resolution|                            |FIXED
         OS/Version|Windows                     |All


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------