Skip to content

Parse *= separately in types #39457

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 3 commits into from
Jul 7, 2020

Conversation

sandersn
Copy link
Member

@sandersn sandersn commented Jul 6, 2020

Previously, when the scanner produced *= as a single token, the type parser ran special-case code to produce an "optional all type", which only makes sense when the = really should be attached to the *. This is often not the case.

The correct solution, which I missed when I first wrote this code, is to have the scanner go back and produce a separate = token, which is what this PR does.

Fixes #38551

Previously, when the scanner produced `*=` as a single token, the type
parser ran special-case code to produce an "optional all type", which
only makes sense when the `=` really should be attached to the `*`. This
is often not the case.

The correct solution, which I missed when I first wrote this code, is to
have the scanner go back and produce a separate `=` token, which is what
this PR does.
@sandersn sandersn requested a review from sheetalkamat July 7, 2020 00:01
@sandersn
Copy link
Member Author

sandersn commented Jul 7, 2020

The reviewers list is on the fritz again, and I'm not quite sure who is best to review this, so @weswigham @elibarzilay can you look as well?

@rachelgshaffer You may also be interested in another JSDoc bug fix.

@sandersn sandersn merged commit 9a65658 into master Jul 7, 2020
@sandersn sandersn deleted the parse-asterisk-equals-separately-in-types branch July 7, 2020 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional function parameter with any return type in jsdoc is treated as required
3 participants