Parse JSDoc ...T and T= only at top-level JSDoc#22661
Merged
sandersn merged 3 commits intoMar 16, 2018
Merged
Conversation
Should include that in this PR |
Member
Author
|
It is included, but I included the commits adding it in the diff, and then asked to merge to master. So it's not displaying. I'm not sure how to fix it short of retargeting the PR somehow. |
ghost
approved these changes
Mar 16, 2018
| type = finishNode(variadic); | ||
| } | ||
| if (token() === SyntaxKind.EqualsToken) { | ||
| type = createJSDocPostfixType(SyntaxKind.JSDocOptionalType, type); |
There was a problem hiding this comment.
Nit: would just return here (or use conditional expression)
|
I checked out the branch and still see |
...T and T= should only be legal at the top level of a type, and only in JSDoc, since at least T= is ambiguous elsewhere. This PR changes parsing to make that happen. The resulting parse tree is now simpler, allowing me to get rid of some code I had to add in the checker.
69a4128 to
3088bc3
Compare
Member
Author
|
Should be fixed now after some shenanigans followed by a force push. |
ghost
approved these changes
Mar 16, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
...TandT=should only be legal at the top level of a type, and only in JSDoc, since at leastT=is ambiguous elsewhere. This PR changes parsing to make that happen. The resulting parse tree is now simpler, allowing me to get rid of some code I had to add in the checker.Originated from @Andy-MS's comments on #22646 and discussion with @weswigham.