mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
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 }); |