https://issues.dlang.org/show_bug.cgi?id=16099
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: [email protected]
Reporter: [email protected]
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.
--