← Back to index
|
Original Bugzilla link
Bug 10974 – static or enum a=expr different from auto a=expr ;
Status
RESOLVED
Resolution
WORKSFORME
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-05T15:00:00Z
Last change time
2014-02-10T05:32:37Z
Assigned to
nobody
Creator
thelastmammoth
Comments
Comment #0
by thelastmammoth — 2013-09-05T15:00:29Z
struct A{ bool bar=true; } auto fun(){ A a; auto ptr=&a.bar; *ptr=false; //a.bar=false; //would work return a; } void main(){ A option2=fun; assert(!option2.bar); static A option1=fun; assert(!option1.bar);//fails enum option3=fun; assert(!option3.bar);//fails }
Comment #1
by andrej.mitrovich — 2013-09-05T15:01:31Z
Confirmed in 2.063.2, however in git-head this code works.
Comment #2
by andrej.mitrovich — 2014-02-10T05:32:37Z
Works in 2.064.2.