[Issue 12814] New: Defining type inference Lambda function with default argument

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 27 19:37:57 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12814

          Issue ID: 12814
           Summary: Defining type inference Lambda function with default
                    argument
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: Jesse.K.Phillips+D at gmail.com

The below code provides an incorrect error. It is not to claim that the code
should or should not be an error.

    auto lam = (cx = 3) { cx = 10; };

Error: cx is used as a type


This could create a lambda which takes an int, or it could error out with
"cannot deduce type from default arguments"

This is similar to: #10491

--


More information about the Digitalmars-d-bugs mailing list