Unofficial wish list status.

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Mon Oct 2 16:11:55 PDT 2006


John Reimer wrote:
> So we have array literals now.  I guess non-static array initialization 
> is possible now that we have this?

No, Walter seems to have forgotten to remove the check that produced the 
error message for non-static array initialization:

     D:\Temp> cat test.d
     void main()
     {
         int[] foo = [1, 2, 3];
     }
     D:\Temp> dmd test.d
     test.d(3): variable test.main.foo is not a static and cannot have 
static initializer

IIRC he has acknowledged this is a bug. So hopefully it'll be fixed in 
the next DMD version.

Workaround until then:

     void main()
     {
         int[] foo; foo = [1, 2, 3];
     }



More information about the Digitalmars-d mailing list