DMD 2.065 Win32 ---------- struct DateInterval { int value; this(int v) { value = v; } enum YEAR = DateInterval(365); } ---------- C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd datetime.d datetime.d(5): Error: cannot create a struct until its size is determined ---------- Same error occurs if I use either enum { YEAR = DateInterval(365) } or enum : DateInterval { YEAR = DateInterval(365) } instead. However, enum DateInterval YEAR = DateInterval(365); compiles without error. This has broken Stewart's Utility Library.
This has been like this since 2.062. I've seen another bug report like this somewhere.
Introduced in https://github.com/D-Programming-Language/dmd/pull/1157
(In reply to Vladimir Panteleev from comment #2) > Introduced in https://github.com/D-Programming-Language/dmd/pull/1157 Ha, I knew it was something old. But I also remember something about this being deliberate.
Oh, didn't look closely at the patch and error message. So is it deliberate?
(In reply to Vladimir Panteleev from comment #4) > Oh, didn't look closely at the patch and error message. So is it deliberate? Actually I recall it being a bugzilla comment, not the pull request itself. I'm not sure anymore, but I'll CC Don.
Found it: https://issues.dlang.org/show_bug.cgi?id=9397#c3
*** This issue has been marked as a duplicate of issue 9397 ***