Object[] ARR_; Object[] ARR(){ if( ARR is null ) // type forgotten underscore ARR_ = [ new Object() ]; return ARR_; } const Object O1 = ARR[1]; // invalid code // results on linux in segmentation fault
If I put a limit on recursion in CTFE, then someone will file a bug report on the limit. I also don't know why this is marked as critical, as removing the bug in the code will allow it to work.
I marked it as critical because of the crash. A solution can be a message in -v mode
This is in the same area as issue 1071 and possibly others, and could be dealt with in the same way (see the comments there). Done well, nobody should have any reason to file a counter-bug to this.
https://github.com/D-Programming-Language/dmd/commit/fcdae7c8071584a7729333571fb86354b7db2b85 https://github.com/D-Programming-Language/dmd/commit/e001f94d281eac901825739060aff2718ea2ee18