Added new diagnostics message to clarify error for type guards#7348
Conversation
|
Hi @Vinatorul, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
| getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), | ||
| node.type); | ||
| node.type, | ||
| undefined, |
There was a problem hiding this comment.
Usually when we pass arguments with the value undefined, we like to add a comment with the parameter name and a space after. So for instance, instead of
undefined,I would write
/*headMessage*/ undefined,|
👍 after Dan's comments |
|
This looks great @Vinatorul. I just had a few style suggestions. We think you should change the error message as I've brought up above. |
|
@DanielRosenwasser thank you! After tests finish I will amend all changes. |
New diagnostics message "A type guard's type must be assignable to its parameter's type." number 2677 is now using in chain report to clarify vague error message for type guards.
|
@DanielRosenwasser done |
Added new diagnostics message to clarify error for type guards
Fixes #6540
New diagnostics message "A type guard's type must be assignable to its parameter's type." number 2677
is now using in chain report to clarify vague error message for type guards.