The following code fragment causes the compiler to crash with the following useful information: "dmd.exe has encountered a problem and needs to close. We are sorry for the inconvenience." //-------------------- public S s = S(); public struct S { private int[] a = [ 0 ]; } //-------------------- I realize the code is incorrect, but I expected an error message, not a trainwreck. Adding initializer information solves the problem: //-------------------- public S s = S([0]); // compiles correctly public struct S { private int[] a = [ 0 ]; } //-------------------- Eliminating the forward reference solves the problem: //-------------------- public struct S { private int[] a = [ 0 ]; } public S s = S(); // compiles correctly //--------------------
I think that removing the forward reference doesn't solve the problem. If I add this line at the end: void main() {} The situation changes.
This was fixed in DMD 2.036.