www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5277] New: Member functions that modify its own state wrongfully marked as strongly pure.

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

           Summary: Member functions that modify its own state wrongfully
                    marked as strongly pure.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: ibuclaw ubuntu.com


--- Comment #0 from Iain Buclaw <ibuclaw ubuntu.com> 2010-11-26 09:11:35 PST ---
Consider:

struct Foo {
    uint num = 0;

    void incNum() pure nothrow{
        num++;
    }
}


incNum gets marked as PUREstrong, when I feel that it should really be PUREweak
as it clearly has side effects.

Regards

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5277


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg gmx.com


--- Comment #1 from Jonathan M Davis <jmdavisProg gmx.com> 2010-11-26 13:47:19
PST ---
I think that this is a duplicate of bug# 5191. If not, it's certainly related.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5277



--- Comment #2 from Iain Buclaw <ibuclaw ubuntu.com> 2010-11-26 14:39:51 PST ---
I would consider it the same issue.

At least, Don's patch in the other report seems to fix it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5277


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bearophile_hugs eml.cc
         Resolution|                            |DUPLICATE


--- Comment #3 from bearophile_hugs eml.cc 2010-11-26 14:42:08 PST ---
Then let's close this one as dupe.

*** This issue has been marked as a duplicate of issue 5191 ***

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