www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6284] New: [Regression 2.054] 'pure' does not work with 'with' statement

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

           Summary: [Regression 2.054] 'pure' does not work with 'with'
                    statement
           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 {
    int a;
}
pure void bug6284() {
    S s;
    auto b = s.a;   // ok
    with (s) {
        auto c = a; // error
    }
}
-----------------------------
x.d(8): Error: pure nested function 'bug6284' cannot access mutable data 'a'
-----------------------------

The error does not happen in 2.053, probably due to the stricter pure check in
2.054.

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




(and yes, the regression is indeed introduced in commit 84b4f "tighten purity
checks".

https://github.com/D-Programming-Language/dmd/commit/84b4f)

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


kennytm gmail.com changed:

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





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

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






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

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


kennytm gmail.com changed:

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



Merging into bug 6293 as the root causes are the same.

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

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


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



21:44:44 PDT ---
https://github.com/D-Programming-Language/dmd/commit/1dac08b77af2826996567f629acf7f43d724cd48

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