TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Use base constraint when testing whether a type needs an `Awaited<T>` wrapper

Open rbuckton opened this issue 4 years ago • 0 comments

When we updated await to use Awaited<T> in 4.5, we avoided introducing a new Awaited<T> wrapper when T is a generic primitive by calling allTypesAssignableToKind. However, when T is a this type, it triggers a circularity error. This change ensures we check against the base constraint of T rather than T itself, which avoids the circularity.

Fixes #47291

rbuckton avatar Oct 19 '22 16:10 rbuckton