www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12819] New: Refused purity conversion of immutable array of


          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 puremagic.com
          Reporter: bearophile_hugs 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[]

May 29 2014