Skip to content

Emit an any for namepath types #37176

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 1 commit into from
Mar 3, 2020

Conversation

weswigham
Copy link
Member

Fixes #36690

When we added an AST node to parse over namepaths in #32563, we didn't add any checker code to handle the new type node anywhere - in many cases, this meant a fallback to the errorType (which is fine), but here we needed to explicitly map the namepath type node into an any type node.

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.

Fix makes sense here -- should we also add a general fallback to these specific early exit?

@weswigham
Copy link
Member Author

should we also add a general fallback to these specific early exit?

? what do you mean?

Copy link
Contributor

@orta orta left a comment

Choose a reason for hiding this comment

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

Thanks! Feels alright to me

@sandersn
Copy link
Member

sandersn commented Mar 3, 2020

Yikes, I mangled that sentence! What I meant was: the function has an early exit for specific cases. Should it also have a general fallback at the bottom sort of like we give errorType when type checking? (That's a question for future work anyway; the code as-is is good as a bug fix.)

@weswigham
Copy link
Member Author

Should it also have a general fallback at the bottom sort of like we give errorType when type checking?

It has a "fallback" already - emit the node as-is, which is used for most typenodes. We only map away jsdoc-y typenodes here, cause printing them in not jsdoc is probably wrong. Namepath is even more special in that it doesn't even have emitter code, so actually just printed as an empty string.

@weswigham weswigham merged commit 5941c6e into microsoft:master Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JsDoc @type {modue:X} + null default value = syntactically invalid .d.ts emit
4 participants