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

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


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.




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