Tested with DMD 2.055 void main() { enum foo={ char[] c="".dup; // works without initialization // string c=""; // same with this // ubyte[] c=[]; // fine auto p = c.ptr; // error here return 0; }(); } Error: CTFE error: cannot cast cast(char*)c to type char*
https://github.com/D-Programming-Language/dmd/commit/a48007b702870dc7f5915f8aea18f3dc3423d8f3 https://github.com/D-Programming-Language/dmd/commit/9830a15fc2873cb36a6d64980aa018ff98b7c0a7