mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 03:09:39 -06:00
8 lines
302 B
TypeScript
8 lines
302 B
TypeScript
// Test case to check the fix
|
|
declare function foo<T extends { dataType: 'a' | 'b' }>(template: T): [T, any, any];
|
|
|
|
// Error case - accessing last element
|
|
const [, , last] = foo({ dataType: 'a', day: 0 });
|
|
|
|
// Working case - not accessing last element
|
|
const [, mid, ] = foo({ dataType: 'a', day: 0 }); |