Skip to content

No synthetic Awaited for unconstrained type when not a type variable #50100

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
Aug 1, 2022

Conversation

rbuckton
Copy link
Contributor

await should only produce Awaited<T> when T's base constraint is any, unknown, {}, or object, or when T is an unconstrained generic. Prior to this change, a Record type with a generic key would satisfy the isGenericObjectType condition, but would have no base constraint, resulting in the introduction of an unnecessary Awaited wrapper around the type.

Fixes #47144

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Jul 29, 2022
@rbuckton rbuckton merged commit 55f2c0c into main Aug 1, 2022
@rbuckton rbuckton deleted the fix47144 branch August 1, 2022 21:19
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
None yet
Development

Successfully merging this pull request may close these issues.

Awaited<T> not resolved to T when T is a generic type
3 participants