This code:
void foo()() if (true) {} // line 1
void main() { foo(1); } // line 2
Prints:
test.d(2): Error: template test.foo does not match any function template declaration. Candidates are:
test.d(1): test.foo()() if (true)
test.d(2): Error: template test.foo()() if (true) cannot deduce template function from argument types !()(int)
I think the diagnostic error output contains following issues:
1. Full signature of the template 'foo' is printed twice. If the template constraint is big, the redundancy would become more problematic.
2. One IFTI error prints two error lines - "does not match ..." and "cannot deduce ...". In principle one error should be associated with one error line.
To fix the issues, I'd propose following output.
test.d(2): Error: template test.foo cannot deduce function from argument types !()(int), candidates are:
test.d(1): test.foo()() if (true)
Advantages:
a. The error "template test.foo cannot deduce ..." shows the full qualified name of candidate template overload set and function argument types.
b. Follwing "candidates are:" and supplemental error lines show the detail of candidate overloads.