http://d.puremagic.com/issues/show_bug.cgi?id=6512

           Summary: [CTFE] new T[][] doesn't work
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-08-16 13:51:20 PDT ---
This is almost an enhancement request.


int foo() {
    new int[][](1, 1);
    return 0;
}
enum _ = foo();
void main() {}


test.d(2): Error: Cannot interpret new int[][](1u,1u) at compile time
test.d(5): Error: cannot evaluate foo() at compile time


While this code works:

int foo() {
    int[][] m;
    m.length = 1;
    m[0].length = 1;
    assert(m == [[0]]);
    return 0;
}
enum _ = foo();
void main() {}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to