[Issue 7742] New: 'More initializers than fields' error with correct number of fields

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 20 11:34:51 PDT 2012


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

           Summary: 'More initializers than fields' error with correct
                    number of fields
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-03-20 11:35:07 PDT ---
This compiles with no errors:


struct Foo {
    int x, y;
    static immutable Foo f = { 1, 2 };
}
void main() {}




But this gives an error, despite I think it used to work (and I think it's
correct code):


struct Foo {
    int x, y;
    static immutable f = Foo(1, 2);
}
void main() {}


DMD 2.059head gives:

test.d(3): Error: more initializers than fields (0) of Foo

-- 
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