Summary: Default initializer is allowed on ref/out params
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrej Mitrovic <> 2012-02-27 
18:44:34 PST ---
void test1(ref bool val = true) {

void test2(out bool val = true) {

void main()
    bool x;
    test1(x);  // compiles ok
    test2(x);  // compiles ok

    test1();  // Error: constant true is not an lvalue
    test2();  // Error: constant true is not an lvalue

The compiler should probably disallow that kind of function signature
regardless of any calls. The initializer doesn't really do anything.

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

Reply via email to