[Issue 12665] New: Cannot create enum of struct within the struct, if the struct has a constructor ("cannot create a struct until its size is determined")
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Apr 27 09:29:35 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12665
Issue ID: 12665
Summary: Cannot create enum of struct within the struct, if the
struct has a constructor ("cannot create a struct
until its size is determined")
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: rejects-valid
Severity: regression
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: smjg at iname.com
Blocks: 340
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.
--
More information about the Digitalmars-d-bugs
mailing list