Comment #0 by ali.akhtarzada — 2020-09-18T07:24:05Z
A lot of the time when you use anonymous templates lambdas, the errors result in identifying the lambda by their internal name (e.g. __lambda1). These lambdas usually have an identifier associated with them so why not show that identifier in the error message?
In the code:
template match(handlers...) {
...
alias handlerOne = handlers[0];
...
handlerOne(); // Error
}
that results in:
source/optional/match.d(28,53): Error: function literal __lambda3() is not callable using argument types (inout(int))
source/optional/match.d(28,53): expected 0 argument(s), not 1
Suggestion to have it result in:
Error: anonymous function __lambda3, identified as handlerOne, is not callable using argument types (inout(int)).
Comment #1 by robert.schadek — 2024-12-13T19:11:38Z