TypeScript/tests/debug_test.ts
copilot-swe-agent[bot] 1f1fe0c217 Revert catastrophically bad fix and investigate root cause of last tuple element issue
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
2025-07-21 22:08:22 +00:00

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 });