www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6075] New: Cannot set value to associative array from a weakly-pure function when the value type has a (pure) opAssign

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6075

           Summary: Cannot set value to associative array from a
                    weakly-pure function when the value type has a (pure)
                    opAssign
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: kennytm gmail.com



Test case:

----------------------------------------
struct S {
    void opAssign(in int other) pure {
    }
}
void add() pure {
    S[int] d;
    d[0] = 1;
}
----------------------------------------
x.d(7): Error: variable __aatmp3 forward referenced
x.d(7): Error: pure nested function 'add' cannot access mutable data '__aatmp3'
x.d(7): Error: variable __aatmp3 forward referenced
x.d(7): Error: pure nested function 'add' cannot access mutable data '__aatmp3'
x.d(7): Error: variable __aatmp3 forward referenced
x.d(7): Error: pure nested function 'add' cannot access mutable data '__aatmp3'
----------------------------------------

The bug is introduced somewhere between 2.048 and 2.052.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 29 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6075




The bug was introduced in commit 44d7881 (fix bug 2451), manifesting itself as
a Segfault (null pointer dereferencing).

The Segfault was later converted to an error in commit 37aacfc (bug 5131).

https://github.com/D-Programming-Language/dmd/commit/44d7881
https://github.com/D-Programming-Language/dmd/commit/37aacfc

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 06 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6075


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch





https://github.com/D-Programming-Language/dmd/pull/140

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 18 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6075


kennytm gmail.com changed:

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



https://github.com/D-Programming-Language/dmd/commit/dfb683f6#L2R9400

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