www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15913] New: cannot initialize immutable fixed size array

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

          Issue ID: 15913
           Summary: cannot initialize immutable fixed size array without
                    similar const-code
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: r.sagitario gmx.de

This is an extraction from the dmd testsuite that is failing with LDC in the
merge-2.071 branch. dmd behaves strangely, too:

void test10282()
{
    //const     int[3] a4 = [1, 3, 6] * 3;
    immutable int[3] a5 = [1, 3, 6] * 3;
}

yields: 
Error: invalid array operation 'a5[] = [1, 3, 6] * 3' for element type 
immutable(int)

while adding the commented line makes it compile.

--
Apr 11 2016