[Issue 16099] New: Inconsistent rules for overloading lambdas

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon May 30 08:40:59 PDT 2016


          Issue ID: 16099
           Summary: Inconsistent rules for overloading lambdas
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: maxsamukha at gmail.com

The compiler neither issues a duplicate declaration error, nor creates a proper
overload set:

alias f = (bool x) {};
alias f = (int y) {};

void main() {
    f(true); // ok
    f(1); // Error: function literal __lambda5 (bool x) is not callable using
argument types (int)

Creating proper overload sets would be a preferred fix.


More information about the Digitalmars-d-bugs mailing list