www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12814] New: Defining type inference Lambda function with


          Issue ID: 12814
           Summary: Defining type inference Lambda function with default
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: Jesse.K.Phillips+D 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

May 27 2014