mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
6 lines
226 B
TypeScript
6 lines
226 B
TypeScript
type DataType = 'a' | 'b';
|
|
declare function foo<T extends { dataType: DataType }>(template: T): [T, any, any];
|
|
|
|
// Test both cases
|
|
const [, , t] = foo({ dataType: 'a', day: 0 });
|
|
const [, s, ] = foo({ dataType: 'a', day: 0 }); |