[Issue 20268] New: anonymous function parameter mismatch errors don't include parameters
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Oct 5 01:48:12 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20268
Issue ID: 20268
Summary: anonymous function parameter mismatch errors don't
include parameters
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: diagnostic
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: elpenguino+D at gmail.com
As of DMD 2.088.0, the error messages for mismatching parameters provide no
hint about an anonymous function's expected parameters.
For example,
```
alias f = (x,y) => true;
auto x = f(1);
```
currently results in an error like
```
onlineapp.d(3): Error: template D main.__lambda1 cannot deduce function from
argument types !()(int), candidates are:
onlineapp.d(2): onlineapp.main.__lambda1
```
Compare with typical functions:
```
bool f(X,Y)(X,Y) { return true; }
auto x = f(1);
```
results in
```
onlineapp.d(3): Error: template D main.f cannot deduce function from argument
types !()(int), candidates are:
onlineapp.d(2): onlineapp.main.f(X, Y)(X, Y)
```
--
More information about the Digitalmars-d-bugs
mailing list