Compiler asserts instead of giving an error message with non-static struct initializers

Max Bolingbroke "batterseapower{no" at sp4/\\/\\}hotmail.com
Sun Oct 29 05:04:56 PST 2006


Hi,

I have found that if you try and use static struct initialization syntax 
on a struct variable you have not declared static you receive an 
assertion failure in DMD and not a compiler error message as I would 
expect. Test case and sample run below.

Thanks!

Max

-----------

struct Point
{
     int x;
     int y;
}

int main()
{
     Point point = { x : 1, y : 0 };	// Should be static

     return point.y;
}

-------------

F:\Programming\Current>dmd testcase.d
Assertion failure: '0' on line 219 in file 'init.c'

abnormal program termination



More information about the Digitalmars-d-bugs mailing list