Better error messages in function calls.#242
Conversation
|
@DanielRosenwasser @JsonFreeman This is an evolution of Daniel's branch. I have introduced a new error message of the form: This error is used as the top-level error in an elaborated error message when none of the candidate signatures are applicable. The error reporting is based on the last candidate signature and uses the offending argument expression as the error span as Jason suggested. Overall this leads to a much better error reporting experience. An alternative for the error message might be It reads a little better even if "compatible with" isn't exactly the correct technical term. |
There was a problem hiding this comment.
Should we mask 'unknown' type in message?
There was a problem hiding this comment.
Easily done, we can just associate the name "any" with the unknownType instance. But I kind of like "unknown" as it indicates that the type came about because of an error.
|
👍 |
There was a problem hiding this comment.
Could you make this
"Argument of type '{0}' is not assignable to parameter of type '{1}"
|
Changed error message to |
|
@ahejlsberg, the Travis build failed, but I ran into this situation earlier, all you have to do is merge from Also 👍 |
|
The error baselines look great! |
Accepting new baselines (not sure why this wasn't already done).
Better error messages in function calls.
Fixes #93.
This is an evolution of #220.