[Issue 4378] New: Array Literals as Default Field Initializers Shared Across Instances.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 23 17:04:15 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4378

           Summary: Array Literals as Default Field Initializers Shared
                    Across Instances.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2010-06-23 17:04:12 PDT ---
import std.stdio;

struct Foo {
    int[] bar = [1, 2, 3, 4, 5];
}

void main() {
    Foo foo;
    foo.bar[0] = 3;

    Foo foo2;
    writeln(foo2.bar);  // 3 2 3 2 5
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list