www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1361] New: DMD 2.002 introduced bug:array initializers are not allowed?

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1361

           Summary: DMD 2.002 introduced bug:array  initializers are not
                    allowed?
           Product: D
           Version: 2.002
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: zhuzhenping gmail.com


int[2][3]myarray = [5,5,5,5,5,5];

int main(char[][] args)
{
return 0;
}

Gives:

“ Error: too many initializers, 6, for array[3]”


-- 
Jul 22 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1361





------- Comment #1 from ibisbasenji gmail.com  2007-07-23 08:42 -------
...did that ever work?

int[2][3] myarray = [[5,5],[5,5],[5,5]];

-- Chris Nicholson-Sauls


-- 
Jul 23 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1361





------- Comment #2 from zhuzhenping gmail.com  2007-07-23 19:02 -------
(In reply to comment #1)
 ...did that ever work?
 
 int[2][3] myarray = [[5,5],[5,5],[5,5]];
 
 -- Chris Nicholson-Sauls
 

Yes,Thank you,it works. --
Jul 23 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1361


zhuzhenping gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




-- 
Jul 23 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1361


zhuzhenping gmail.com changed:

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




-- 
Jul 23 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1361





------- Comment #3 from bugzilla digitalmars.com  2007-07-23 19:35 -------
The original snippet should never have compiled, it wasn't a compiler bug.
Although the code is valid C, it is not valid D.


-- 
Jul 23 2007