Skip to content

Resolve SymbolFlags.Type only at first in jsdoc getTypeFromTypeReference #32947

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 19, 2019

Conversation

weswigham
Copy link
Member

Before falling back to SymbolFlags.Value.

Previously, by having both simultaneously at first, we'd find the local symbol of a merged const/type alias symbol, which only actually has value meaning applied to it. In normal codepaths, we'd skip over that to the export symbol of the same name, which has the intended type meaning.

This fixes a regression in the webpack user test. (When we started binding @enum tags a typedefs, we started having merged const/type aliases with separate export/local symbols in js (just like in TS), which were previously much harder to make)

@weswigham
Copy link
Member Author

@RyanCavanaugh seeing as this fixes a regression from 3.5 (though I didn't open an issue for it), would we want to port this to the 3.6 final release?

@sandersn
Copy link
Member

note specifically that exported @enum is broken, and (in theory) @typedefs that share a name with an exported value. We've never seen any of the second kind, though.

@weswigham weswigham merged commit d9f0212 into microsoft:master Aug 19, 2019
@weswigham weswigham deleted the fix-webpack-user-suite-js-enum branch August 19, 2019 18:31
@weswigham
Copy link
Member Author

@typescript-bot cherry-pick this to release-3.6

@typescript-bot
Copy link
Collaborator

Hey @weswigham, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-3.6 manually.

weswigham added a commit to weswigham/TypeScript that referenced this pull request Aug 19, 2019
timsuchanek pushed a commit to timsuchanek/TypeScript that referenced this pull request Sep 11, 2019
…nce (microsoft#32947)

* Fix lookup of exported eunm type alias in local scope in JS

* Fix by adjusting type lookup fallback behavior to not include SymbolFlags.Value in its initial lookup instead
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 3.6.4 milestone Sep 24, 2019
DanielRosenwasser added a commit that referenced this pull request Sep 24, 2019
Port #32947 to `release-3.6`
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.

4 participants