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

           Summary: array[]++ and array[]-- too?
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-09-06 03:17:47 PDT ---
This code contains two operations that are refused by DMD2.055beta:

void main() {
    int[10] a;
    a[] += 1; // OK
    ++a[];    // OK
    --a[];    // OK
    a[]++;    // line 6, error
    a[]--;    // line 7, error
}


test2.d(6): Error: slice expression a[] is not a modifiable lvalue
test2.d(6): Error: 'a[]' is not a scalar, it is a int[]
test2.d(6): Error: cannot cast int to int[]
test2.d(7): Error: slice expression a[] is not a modifiable lvalue
test2.d(7): Error: 'a[]' is not a scalar, it is a int[]
test2.d(7): Error: cannot cast int to int[]


Maybe it's better to allow the last two lines too.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to