https://d.puremagic.com/issues/show_bug.cgi?id=11813

           Summary: Improve IFTI error diagnostic
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2013-12-24 18:39:45 PST ---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to