Skip to content

Fix bug: Report errors on extends expression in JS even if an @augments tag is present #18854

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
1 commit merged into from
Oct 2, 2017

Conversation

ghost
Copy link

@ghost ghost commented Sep 29, 2017

Sequel to #18775
Turns out getBaseConstructorTypeOfClass was the only place we checked the extends expression, so that PR turned off checking if an @augments tag was present.
It would seem neater to have a checkExpression(baseTypeNode) call in checkClassLikeDeclaration, but that would mean we check it twice in the usual case.

@ghost ghost requested a review from sandersn September 29, 2017 21:28
@ghost ghost force-pushed the jsdocAugments_errorInExtendsExpression branch from a6bf41d to bb76aa7 Compare September 29, 2017 22:09
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'm curious — in JS, which wins, @augments or extends? Or do we issue an error if they differ? I'd say we should issue an error and then let extends win.

@ghost
Copy link
Author

ghost commented Oct 2, 2017

The PR for @extends is still open at #18706

@ghost ghost merged commit e698072 into master Oct 2, 2017
@ghost ghost deleted the jsdocAugments_errorInExtendsExpression branch October 2, 2017 17:33
@ghost ghost mentioned this pull request Oct 2, 2017
@sandersn
Copy link
Member

sandersn commented Oct 2, 2017

No, what happens for

/** @augments A */
class B extends C { }

shouldn't we issue an error saying that you can't inherit from both A and C ?

@ghost
Copy link
Author

ghost commented Oct 2, 2017

See the test jsdocAugments_nameMismatch, added in #18775.

@sandersn
Copy link
Member

sandersn commented Oct 2, 2017

Thanks 👍

@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
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.

1 participant