Summary: [CTFE] Problem with inout
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-08-17 07:46:59 PDT ---
D2 code:

inout(int[]) foo(inout int[] data) {
    return data;
void main() {
    enum int[] a = [1, 2];
    const r1 = foo(a); // OK
    enum r2 = foo(a); // Not OK

DMD 2.055beta gives:

test.d(7): Error: variable test2.main.r2 only fields, parameters or stack based
variables can be inout
test.d(7): Error: cannot evaluate foo([1,2]) at compile time

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

Reply via email to