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

Correctly check computed property names in type-space get/set accessors #47156

Merged
merged 3 commits into from
Feb 1, 2022

Conversation

RyanCavanaugh
Copy link
Member

@RyanCavanaugh RyanCavanaugh commented Dec 15, 2021

Fixes #47146 (introduced by #42425 which enabled this syntax)

Previously this code ran without error:

type OH_NO = {
  get [K in WAT](): string
};

because we incorrectly swallowed the errors in checkComputedPropertyName under the assumption that we were looking at a { [K in T]: U } declaration. The code path where the error would have been detected -- in the mapped checking logic -- obviously does not run because this is not actually a mapped type.

Thankfully the computed type was completely useless (see comments in linked issue), so it isn't feasible that anyone took a dependency on this.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Dec 15, 2021
@RyanCavanaugh RyanCavanaugh merged commit 2172e19 into microsoft:main Feb 1, 2022
@RyanCavanaugh RyanCavanaugh deleted the fix47146 branch February 1, 2022 20:49
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.

infer on setter argument gives unknown
3 participants