[Issue 6284] New: [Regression 2.054] 'pure' does not work with 'with' statement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 10 13:28:31 PDT 2011


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 at puremagic.com
        ReportedBy: kennytm at gmail.com


--- Comment #0 from kennytm at 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: -------


More information about the Digitalmars-d-bugs mailing list