[Issue 1015] New: Compile-time functions cannot return multidimensional array literals

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 1 16:54:20 PST 2007


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

           Summary: Compile-time functions cannot return multidimensional
                    array literals
           Product: D
           Version: 1.007
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: tknott at gmail.com


See title.  I'm not sure if this is a bug or not (the spec doesn't specify
anything related to compile-time handing of multidimensional arrays), but 
compile-time handling of multidimensional arrays (necessary for arrays of
strings) seems broken right now.  More specific error messages or more
runtime-like handling, as well as a clarification in the spec, would be much
better.  This bug is probably also related to bug 995 (if not a duplicate,
though I think this issue is different enough to warrant a new bug report
considering it has a different error message).  Here's a test case:

char[][] func()
{
    return [""]; //Line 3
}

char[][] foo = func(); //test.d(3): Error: non-constant expression [""]


-- 



More information about the Digitalmars-d-bugs mailing list