[Issue 15913] New: cannot initialize immutable fixed size array without similar const-code
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Apr 11 23:35:24 PDT 2016
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 at puremagic.com
Reporter: r.sagitario at 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.
--
More information about the Digitalmars-d-bugs
mailing list