Bug 6075 – Cannot set value to associative array from a weakly-pure function when the value type has a (pure) opAssign
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2011-05-29T09:01:00Z
Last change time
2011-06-27T07:27:32Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
kennytm
Comments
Comment #0 by kennytm — 2011-05-29T09:01:33Z
Test case:
----------------------------------------
struct S {
void opAssign(in int other) pure {
}
}
void add() pure {
S[int] d;
d[0] = 1;
}
----------------------------------------
x.d(7): Error: variable __aatmp3 forward referenced
x.d(7): Error: pure nested function 'add' cannot access mutable data '__aatmp3'
x.d(7): Error: variable __aatmp3 forward referenced
x.d(7): Error: pure nested function 'add' cannot access mutable data '__aatmp3'
x.d(7): Error: variable __aatmp3 forward referenced
x.d(7): Error: pure nested function 'add' cannot access mutable data '__aatmp3'
----------------------------------------
The bug is introduced somewhere between 2.048 and 2.052.