Skip to content

case(Awaited): add nested thenable case - #38198

Open
kyu-rong wants to merge 1 commit into
type-challenges:mainfrom
kyu-rong:test/awaited-nested-thenable
Open

kyu-rong wants to merge 1 commit into
type-challenges:mainfrom
kyu-rong:test/awaited-nested-thenable

Conversation

@kyu-rong

@kyu-rong kyu-rong commented Jun 8, 2026

Copy link
Copy Markdown

add Test Case to Awaited

The current cases cover nested Promises (Z, Z1) and a single-level thenable (T), but not a thenable whose resolved value is itself a thenable.

A solution that recurses only on Promise instead of PromiseLike passes all the existing cases but stops one level early on this one, while the built-in Awaited keeps unwrapping it down to number. Added T1 following the existing T case:

type T1 = { then: (onfulfilled: (arg: T) => any) => any }
// ...
Expect<Equal<MyAwaited<T1>, number>>,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant