Skip to content

Bind a jsdoc enum as SymbolFlags.TypeAlias and not SymbolFlags.Enum #32520

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 4 commits into from
Jul 26, 2019

Conversation

weswigham
Copy link
Member

Fixes #32413

@weswigham weswigham requested a review from sandersn July 23, 2019 00:06
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.

🎉

@@ -97,7 +97,7 @@ class TypeWriterWalker {
if (!isSymbolWalk) {
// Don't try to get the type of something that's already a type.
// Exception for `T` in `type T = something` because that may evaluate to some interesting type.
if (ts.isPartOfTypeNode(node) || ts.isIdentifier(node) && !(ts.getMeaningFromDeclaration(node.parent) & ts.SemanticMeaning.Value) && !(ts.isTypeAlias(node.parent) && node.parent.name === node)) {
if (ts.isPartOfTypeNode(node) || ts.isIdentifier(node) && !(ts.getMeaningFromDeclaration(node.parent) & ts.SemanticMeaning.Value) && !(ts.isTypeAliasDeclaration(node.parent) && node.parent.name === node)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me see if I can summarise what this means: we now bail for @callback, @typedef and @enum and some (which?) type aliases. Before it looks like there was a check that @callback and @typedef would usually fail, but sometimes incorrectly pass. But I'm not sure in what circumstances.

Copy link
Member Author

@weswigham weswigham Jul 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMeaningFromDeclaration on a JSDoc (as is the parent of all of these) isn't handled afaik, so those cases are already unreachable, as it's defaulted to All.

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.

Use SymbolFlags.TypeAlias when binding a jsdoc enum instead of SymbolFlags.Enum
2 participants