July 05, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1315

           Summary: CTFE doesn't default initialise arrays of structs
           Product: D
           Version: 1.018
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: clugdbug@yahoo.com.au


Seems as though struct arrays aren't default initialised inside CTFE.
CTFE disallows concatenation to an unitialised struct array, also can't get the
length.
Workaround is easy - just initialise the array to [].

-----------
struct S {
    int a;
}

int func()
{
/* This is OK
    int [] q;
    q ~=4;
*/
    S [] s; // makes the next lines fail. (but  S[] s = []; compiles).
    s ~= S(7); // fails
    return s.length; // this fails too
}

void main()
{
    const int x = func();
}


-- 

September 29, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1315


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla@digitalmars.com  2007-09-28 22:06 -------
Fixed dmd 1.021 and 2.004


--