www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10002] New: 2.062 -> 2.063 call of "remove" is impure

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

           Summary: 2.062 -> 2.063 call of "remove" is impure
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: henning still-hidden.de


--- Comment #0 from Henning Pohl <henning still-hidden.de> 2013-04-28 14:50:14
PDT ---
import std.algorithm;

class Node {
    Node parent;
    Node[] children;

    void foo() pure {
        parent.children.remove!(n => n is parent)();
    }
}

2.063:
-----
main.d(8): Error: pure function 'foo' cannot call impure function 'remove'
-----

Note: Moving "parent" into "foo" will make 2.062 reject it, too.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 28 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10002


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

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


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-04-28 18:37:55 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1945

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 28 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10002



--- Comment #2 from github-bugzilla puremagic.com 2013-05-08 17:45:51 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/04b5b9a7da4b0c3da5f2d9c722ac08725548c361
fix Issue 10002 - calling std.algorithm.remove is impure

https://github.com/D-Programming-Language/dmd/commit/75d36600d2f39777470c8b407569e08ead9c08d6
Merge pull request #1945 from 9rnsr/fix10002

[REG2.063a] Issue 10002 - calling std.algorithm.remove is impure

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 08 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10002


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

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


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