-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Added new diagnostics message to clarify error for type guards #7348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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; |
checkTypeAssignableTo(typePredicate.type, | ||
getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), | ||
node.type); | ||
node.type, | ||
undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.