Skip to content

Fix binding of jsdoc typedefs with no in-comment name attached to an expression statement #32610

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
Aug 2, 2019

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Jul 29, 2019

#32520 migrated the @enum tag to bind the same way as a @typedef, which revealed thru this user test diff that @typedef tags did not correctly support binding to expression statements (only variable declarations). This PR remedies that deficiency, so @enums bound to expression statements continue to function, as do @typedefs, meaning this:

var NS = {};
/**
 * @typedef {number}
 */
NS.Whatever = "ok";

now works, and binds type Whatever = number into NS (previously it would silently fail to bind anything).

In doing so I cleaned up some of the JS-related binding flags - Assignment no longer implies Type or Value (it's just a flag that means the declaration is from JS and may merge in odd ways, the symbol maybe be only a type, only a value, or a combination thereof), and the binder always binds all psuedonamespace references in binary expression left hand side expressions to the appropriate symbol, not just if it's the first time the namespace has been referenced. This means find all references on one of these namespaces will have many more entries, and more importantly, the nodes will always have a .symbol for use in the delayed typedef binding and in checking.

Fixes #32669

@weswigham
Copy link
Member Author

cc @sandersn because the reviewers dropdown breaks all the time~

@weswigham
Copy link
Member Author

@typescript-bot user test this - I expect some outstanding failures from unrelated things, but I wanna see the new diff

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 29, 2019

Heya @weswigham, I've started to run the parallelized community code test suite on this PR at 340a718. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@weswigham
Copy link
Member Author

@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 30, 2019

Heya @weswigham, I've started to run the parallelized community code test suite on this PR at bd74b7a. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

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.

First round of comments; still need to understand the symbol baseline changes.

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'd like answers to my 2 questions about the baselines before you merge.

@weswigham weswigham merged commit 6b4f730 into microsoft:master Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@typdef attached to binary expression statement is not bound
3 participants