Skip to content

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

Merged
weswigham merged 3 commits intomicrosoft:masterfrom
weswigham:fix-webpack-user-suite-js-enum
Aug 19, 2019
Merged

Resolve SymbolFlags.Type only at first in jsdoc getTypeFromTypeReference#32947
weswigham merged 3 commits intomicrosoft:masterfrom
weswigham:fix-webpack-user-suite-js-enum

Conversation

@weswigham
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@typescript-bot
Copy link
Copy Markdown
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`
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
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.

4 participants