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

          Issue ID: 12648
           Summary: Array operation return type
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: [email protected]
          Reporter: [email protected]

I think both the following should compile:


int[1] foo1(int[1] a) {
    a[] += 10;
    return a;         // OK.
}
int[1] foo2(int[1] a) {
    return a[] += 10; // Error.
}
void main() {}


DMD 2.066alpha gives:

test.d(6,16): Error: cannot implicitly convert expression
(_arrayExpSliceAddass_i(a[], 10)) of type int[] to int[1]

--

Reply via email to