Summary: Array ops on const arrays
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-08-17 07:06:13 PDT ---
This D2 program shows two problems (dmd 2.048):

void foo(const double[] arr1) {
    arr1[] += 1;      // line 2, no error here
    double[] arr2;
    arr1[] += arr2[]; // line 4, Error here
void main() {}

The first problem is at line 2, where the const nature of arr1 is ignored.

The second problem is at line 4, that generates a wrong error message:

test.d(4): Error: invalid array operation arr1[] += cast(const(double[]))arr2[]
(did you forget a [] ?)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to