[Issue 13556] New: inconsistent 'new' syntax for arrays

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 28 20:15:47 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13556

          Issue ID: 13556
           Summary: inconsistent 'new' syntax for arrays
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: ketmar at ketmar.no-ip.org

this is accepted by DMD:

  int[] a0 = new int[256];

and this is not:

  int[][] a1 = new int[256][256];


what i'm expecting is that second sample will be the same as:

  int[][] a1 = new int[][](256, 256);

currently DMD complains that it "cannot implicitly convert expression (new
int[256][](256u)) of type int[256][] to int[][]".

--


More information about the Digitalmars-d-bugs mailing list