Following code should work, but doesn't. bool test() { string dtor; struct S { char x = 'x'; ~this() { dtor ~= x; } } { S[2] a; } // line 12 assert(dtor == "xx"); dtor = ""; { S[2] a = [S('a'), S('b')]; } assert(dtor == "ab"); return true; } static assert(test()); Currently the case outputs weird CTFE error. test.d(12): Error: static variable typeid(S[2]) cannot be read at compile time test.d(21): called from here: test() test.d(21): while evaluating: static assert(test())
https://github.com/D-Programming-Language/dmd/pull/4100
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6ee121df3eec74835b9d6e75b57af6f25bf009a9 fix Issue 13669 - [CTFE] Destructor call on static array variable is not yet supported in CTFE
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/59a5fd49d1f03be8d0ac44abf03c109880f2aefb Move issue 13669 test in runnable, and fix order of dtor calls
Commits pushed to 2.067 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6ee121df3eec74835b9d6e75b57af6f25bf009a9 fix Issue 13669 - [CTFE] Destructor call on static array variable is not yet supported in CTFE https://github.com/D-Programming-Language/dmd/commit/59a5fd49d1f03be8d0ac44abf03c109880f2aefb Move issue 13669 test in runnable, and fix order of dtor calls