http://d.puremagic.com/issues/show_bug.cgi?id=9425
Summary: Static struct initializer fails to init array Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: sebastiang...@t-online.de --- Comment #0 from Sebastian Graf <sebastiang...@t-online.de> 2013-01-29 09:14:41 PST --- I found this when fixing a bug in ldc on Win8 x64. I'm pretty sure all platforms are concerned, because the linux CI server complained for the same reason. import std.conv; struct S { int array[4]; } void main() { int array[4] = 67; // array = [67, 67, 67, 67] static S s = S(67); // s.array = [67, 0, 0, 0] assert(array == s.array, "s.array (actual): " ~ to!string(s.array) ~ ", array (expected): " ~ to!string(array)); } When initializing array in S' initializer, only the first element of the array takes the value, the others are zero'd. I expected the array to be filled with the value. Note that this is the case when you don't declare s as static, so I assume it is a bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------