Skip to content

support type inference of object non-literal keys #42158

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

Closed

Conversation

Zzzen
Copy link
Contributor

@Zzzen Zzzen commented Dec 30, 2020

Fixes #29718, Fixes #47737

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Dec 30, 2020
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.

The existing computed property case needs to be fixed.

@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src'. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src'.

@typescript-bot typescript-bot added the lib update PR modifies files in the `lib` folder label Jan 16, 2021
@Zzzen Zzzen force-pushed the contextual-type-of-non-literal-key branch 2 times, most recently from 940d2b3 to 04abc00 Compare January 16, 2021 14:56
@sandersn sandersn requested review from weswigham and rbuckton March 10, 2021 16:53
@Zzzen Zzzen force-pushed the contextual-type-of-non-literal-key branch from 422bfc4 to c25d033 Compare February 5, 2022 05:07
@Zzzen Zzzen requested a review from sandersn February 5, 2022 05:27
@sandersn sandersn assigned rbuckton and unassigned weswigham Feb 10, 2022
Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

@sandersn I still think a more complete fix like #46464 and #21070 is warranted for this and related issues. Our current behavior on computed names in object literals as a whole is very much from a time before literal types existed :(

Given how those have fared, I'm disinclined to take this as-is - I really wanna see us fix object literal computed names as a whole, rather than slowly adopt a patchwork of changes; and I'm really not buying the churn argument as a great reason to not adopt some of your older proposed changes so long as issues like these keep getting filed.

@sandersn
Copy link
Member

All right, I'll close this for now.

@sandersn sandersn closed this Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug lib update PR modifies files in the `lib` folder
Projects
Archived in project
5 participants