www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11813] New: Improve IFTI error diagnostic

reply d-bugmail puremagic.com writes:
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



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: -------
Dec 24 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11813


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

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



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: -------
Dec 24 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11813




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


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: -------
Dec 30 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
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: -------
Dec 30 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11813


bearophile_hugs eml.cc changed:

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



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: -------
Dec 30 2013