Skip to content

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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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