Bug 16099 – Inconsistent rules for overloading lambdas

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-05-30T15:40:59Z
Last change time
2018-02-25T12:19:53Z
Assigned to
No Owner
Creator
Max Samukha

Comments

Comment #0 by maxsamukha — 2016-05-30T15:40:59Z
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.
Comment #1 by slavo5150 — 2017-11-18T13:00:35Z
*** Issue 17983 has been marked as a duplicate of this issue. ***
Comment #2 by ag0aep6g — 2018-02-25T12:13:49Z
*** Issue 18520 has been marked as a duplicate of this issue. ***
Comment #3 by ag0aep6g — 2018-02-25T12:19:53Z
*** This issue has been marked as a duplicate of issue 15225 ***