Not sure this actually should be possible... I guess it would get funky as typescript would have to deal with naming conflicts.
TypeScript Version: 4.1.0-dev
Search Terms:
Variadic, Named Tuples
Code
type Append<I, T extends unknown[]> = [...T, last:I];
type FooBar = Append<string, [foo: number, bar: boolean]>
Expected behavior:
Should preserve named tuples labels:
type FooBar = [foo: number, bar: boolean, last: string]
Actual behavior:
type FooBar = [number, boolean, string]
Playground Link:
https://www.typescriptlang.org/play?ts=4.0.0-beta#code/C4TwDgpgBAgmkDsAmAeAkgGigFShAHsBMgM5QCuCA1ggPYDuCA2gLoB8UAvFEwHT-YsAGwCGJYAC40LANwAoUJCgAxWrQBCIgE5dY8YqnFaAlggDmWJgDM1EqAnIBbAEYQtWZ9rvO1QiCIR2OSA
Related Issues:
none
Not sure this actually should be possible... I guess it would get funky as typescript would have to deal with naming conflicts.
TypeScript Version: 4.1.0-dev
Search Terms:
Variadic, Named Tuples
Code
Expected behavior:
Should preserve named tuples labels:
type FooBar = [foo: number, bar: boolean, last: string]Actual behavior:
type FooBar = [number, boolean, string]Playground Link:
https://www.typescriptlang.org/play?ts=4.0.0-beta#code/C4TwDgpgBAgmkDsAmAeAkgGigFShAHsBMgM5QCuCA1ggPYDuCA2gLoB8UAvFEwHT-YsAGwCGJYAC40LANwAoUJCgAxWrQBCIgE5dY8YqnFaAlggDmWJgDM1EqAnIBbAEYQtWZ9rvO1QiCIR2OSA
Related Issues:
none