www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1015] New: Compile-time functions cannot return multidimensional array literals

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: tknott 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 [""]


-- 
Mar 01 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1015


clugdbug yahoo.com.au changed:

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





This works in DMD 1.020. It was probably a duplicate of bug 995.


-- 
Sep 13 2007