[Issue 12819] New: Refused purity conversion of immutable array of arrays
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu May 29 05:30:31 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12819
Issue ID: 12819
Summary: Refused purity conversion of immutable array of arrays
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: rejects-valid
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
I am not sure, but perhaps both functions should compile:
immutable(string)[] foo() pure {
char[][] a;
return a; // OK
}
string[] bar() pure {
char[][] b;
return b; // Error
}
void main() {}
DMD 2.066alpha gives:
test.d(7,12): Error: cannot implicitly convert expression (b) of type char[][]
to string[]
--
More information about the Digitalmars-d-bugs
mailing list