Summary: [tdpl] ++x should be an lvalue
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrei Alexandrescu <> 2009-10-08 
14:12:33 PDT ---
This doesn't compile:

ref int bump(ref int x) { return ++x; }

The error message reveals two other issues:

Error: x += 1 is not an lvalue

1. The increment is rewritten as x += 1, but it shouldn't as it's a
fundamentally different operation

2. x += 1 is not a value itself. Indeed this doesn't compile either:

ref int bump(ref int x) { return x += 1; }

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

Reply via email to