Bug 6284 – [Regression 2.054] 'pure' does not work with 'with' statement

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2011-07-10T13:23:00Z
Last change time
2011-08-01T21:44:44Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2011-07-10T13:23:23Z
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.
Comment #1 by kennytm — 2011-07-10T13:30:33Z
(and yes, the regression is indeed introduced in commit 84b4f "tighten purity checks". https://github.com/D-Programming-Language/dmd/commit/84b4f)
Comment #2 by kennytm — 2011-07-11T13:33:35Z
Comment #3 by kennytm — 2011-07-12T13:22:25Z
Comment #4 by kennytm — 2011-07-16T01:04:00Z
Merging into bug 6293 as the root causes are the same. *** This issue has been marked as a duplicate of issue 6293 ***
Comment #5 by bugzilla — 2011-08-01T21:44:44Z