Summary: Default arguments of out and ref arguments
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-04-16 18:11:29 PDT ---
This D2 program compiles with no errors and runs raising no assert errors:

void foo(out int x=1, ref int y=2) {}
void main() {
    int x, y;
    foo(x, y);
    assert(x == 0 && y == 0);

If default arguments for out and ref arguments can't be made to work, then I
suggest to disallow them statically.

In Ada (2012) "A default_expression is only allowed in a
parameter_specification for a formal parameter of mode in." See point 19 here:

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

Reply via email to