Thread overview
[Issue 11813] New: Improve IFTI error diagnostic
Dec 25, 2013
Kenji Hara
Dec 25, 2013
Kenji Hara
Dec 31, 2013
Walter Bright
December 25, 2013
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: nobody@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@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: -------
December 25, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11813


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-12-24 19:50:46 PST ---
https://github.com/D-Programming-Language/dmd/pull/3020

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 31, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11813



--- Comment #2 from github-bugzilla@puremagic.com 2013-12-30 17:22:12 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/696dfbf44d5d287aa60a429d47ff367daaae1fa6 fix Issue 11813 - Improve IFTI error diagnostic

https://github.com/D-Programming-Language/dmd/commit/391a3d2186ccd612bc4ede603c820b68a7f9fb63 Merge pull request #3020 from 9rnsr/faildiag

Issue 11813 & 11814 - improve diagnostic messages on IFTI failure

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 31, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11813


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 31, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11813


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #3 from bearophile_hugs@eml.cc 2013-12-30 20:02:04 PST ---
This reduces the noise of the error messages, it's a nice improvement.

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