Thread overview
[Issue 7742] New: 'More initializers than fields' error with correct number of fields
Mar 22, 2012
Don
Mar 25, 2012
Walter Bright
March 20, 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@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@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: -------
March 22, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7742


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2012-03-22 08:27:22 PDT ---
Almost the same as bug 7094.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 25, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7742



--- Comment #2 from github-bugzilla@puremagic.com 2012-03-25 12:30:52 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/92c8e7bdcc9ad100f8efca5cac1095ff255413d3
fix issue 7742 - 'More initializers than fields' error with correct number of
fields

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 25, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7742


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 25, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7742



--- Comment #3 from bearophile_hugs@eml.cc 2012-03-25 13:23:16 PDT ---
*** Issue 7094 has been marked as a duplicate of this issue. ***

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