[Issue 3488] Segfault(expression.c): enum declared with struct static initializer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 9 03:24:22 PST 2009


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



--- Comment #3 from Don <clugdbug at yahoo.com.au> 2009-11-09 03:24:21 PST ---
It's happening because static struct initializers with names are not evaluated
at compile time. And this is because init.c, StructInitializer::toExpression()
doesn't deal with it. BTW -- now that we have struct literals, I'm not sure
that we need struct initializers any more. They're a bit annoying,
implementation-wise.

--- TEST CASE ---
struct Move{ int Dx; }
immutable Move genMove = { Dx:4};
static assert(genMove.Dx == 4); // not evaluatable at compile time.

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