See title. I'm not sure if this is a bug or not (the spec doesn't specify anything related to compile-time handing of multidimensional arrays), but compile-time handling of multidimensional arrays (necessary for arrays of strings) seems broken right now. More specific error messages or more runtime-like handling, as well as a clarification in the spec, would be much better. This bug is probably also related to bug 995 (if not a duplicate, though I think this issue is different enough to warrant a new bug report considering it has a different error message). Here's a test case:
char[][] func()
{
return [""]; //Line 3
}
char[][] foo = func(); //test.d(3): Error: non-constant expression [""]
Comment #1 by clugdbug — 2007-09-13T07:16:00Z
This works in DMD 1.020. It was probably a duplicate of bug 995.