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.