May 20, 2011 [Issue 6039] New: C-style initialization of structs doesn't take field initializers into account | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6039 Summary: C-style initialization of structs doesn't take field initializers into account Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: andrej.mitrovich@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-05-19 21:43:15 PDT --- import std.stdio; struct S { int a; int b = 2;} void main() { S a = S(1); S b = {1}; writeln([a.tupleof]); // [1, 2] writeln([b.tupleof]); // [1, 0] assert(a == b); // fails } AFAIK there was some talk about deprecating C-style struct initialization, or am I wrong about that? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 17, 2013 [Issue 6039] C-style initialization of structs doesn't take field initializers into account | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=6039 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WORKSFORME --- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-09-17 13:10:00 PDT --- Fixed in a version earlier than 2.062, don't know exactly which one. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation