Closed
Description
Search Terms
Generics
Suggestion
Decomposition of tuple type
Examples
type Hoge<T extends any[]> = T extends [infer X, ...infer XS] ? X | Hoge<XS> : never;
There is a problem of #14174
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript / JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. new expression-level syntax)