www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Improvement of error messages for failed overloads by attaching custom

I just have an idea which some of you may find good. I described 
my idea on DMD issue tracker but noone responded, so I'm posting 
here also.
Link to issue:
https://issues.dlang.org/show_bug.cgi?id=16059

tldr:
Compiler error messages for failed overloads are not helpful 
enough.
Some useful information that the messages **should** have cannot 
be trivially generated from the code.
Extend the language so that a library author can write something 
like this:

pragma(on_overload_resolution_error, "std.conv.toImpl", "<custom 
error message>")

Examples of "<custom error message>" that library author may 
choose to write:
- "The most common reason for \"toImpl\" overload resolution 
error is using the \"to\" function incorrectly."
- "The \"to\" function is intended to be used for types <short 
summary of acceptable types in English language>."
- "Some of the common fixes are: <short summary of common fixes>."

Does any of this make sense?
Jun 01 2016