http://d.puremagic.com/issues/show_bug.cgi?id=4662

           Summary: Array ops on const arrays
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to