digitalmars.D.bugs - Compiler asserts instead of giving an error message with non-static
- Max Bolingbroke (22/22) Oct 29 2006 Hi,
- Brad Roberts (2/34) Oct 29 2006 Yup.. see: http://d.puremagic.com/bugzilla/show_bug.cgi?id=378
- Max Bolingbroke (3/4) Oct 29 2006 Oops :) I didn't find that since I searched for "line 219", and of
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
Oct 29 2006
Max Bolingbroke wrote: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 terminationYup.. see: http://d.puremagic.com/bugzilla/show_bug.cgi?id=378
Oct 29 2006
Brad Roberts wrote:Yup.. see: http://d.puremagic.com/bugzilla/show_bug.cgi?id=378Oops :) I didn't find that since I searched for "line 219", and of course the line number changes...
Oct 29 2006