Skip to content
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

Issue serialization error when attempting to serialize a late-bound name from a mapped type #49221

Conversation

weswigham
Copy link
Member

Fixes #49065 - we now consistently issue an error on the mapped type form of the declaration, just like the anonymous object declaration. (Late bound names fed into mapped types don't get CheckFlags.Late set on them because they didn't go through the late binding process, however our output of the type will, so the name being a late bindable name alone is sufficient to need to issue the error)

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels May 23, 2022
Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

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

Makes sense in terms of doing the same thing as the object type declaration, but why can’t this one serialize as typeof import("./a").Timestamp?

@weswigham
Copy link
Member Author

weswigham commented May 24, 2022

That would be valid in a type position, but computed property names are value positions, and our only logic for a value position is "preserve what the user wrote", except because this name came from a mapped type, the user wrote nothing, so there's nothing we can preserve.

@sandersn
Copy link
Member

@weswigham does this need more review or is it ready to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Missing import in generated declaration file
4 participants