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


--- Comment #0 from kennytm gmail.com 2011-07-10 13:23:23 PDT ---
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



--- Comment #1 from kennytm gmail.com 2011-07-10 13:30:33 PDT ---
(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


--- Comment #2 from kennytm gmail.com 2011-07-11 13:33:35 PDT ---
DMD pull #233.

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



--- Comment #3 from kennytm gmail.com 2011-07-12 13:22:25 PDT ---
DMD pull #243.

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


--- Comment #4 from kennytm gmail.com 2011-07-16 01:04:00 PDT ---
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


--- Comment #5 from Walter Bright <bugzilla digitalmars.com> 2011-08-01
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