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
Almost the same as bug 7094.
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
*** Issue 7094 has been marked as a duplicate of this issue. ***