Skip to content

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

Merged
merged 1 commit into from
Mar 2, 2016

Conversation

Vinatorul
Copy link
Contributor

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.

@msftclas
Copy link

msftclas commented Mar 2, 2016

Hi @Vinatorul, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

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,
Copy link
Member

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,

@RyanCavanaugh
Copy link
Member

👍 after Dan's comments

@DanielRosenwasser
Copy link
Member

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.

@Vinatorul
Copy link
Contributor Author

@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.
@Vinatorul
Copy link
Contributor Author

@DanielRosenwasser done

DanielRosenwasser added a commit that referenced this pull request Mar 2, 2016
Added new diagnostics message to clarify error for type guards
@DanielRosenwasser DanielRosenwasser merged commit d6c5606 into microsoft:master Mar 2, 2016
@Vinatorul Vinatorul deleted the issue6540 branch March 2, 2016 22:00
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants