excessPropertyCheckingInArrayDestructuring.ts(12,28): error TS2322: Type '"c"' is not assignable to type '"a" | "b"'.
excessPropertyCheckingInArrayDestructuring.ts(13,26): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ dataType: "a" | "b"; }'.


==== excessPropertyCheckingInArrayDestructuring.ts (2 errors) ====
    declare function foo<T extends { dataType: 'a' | 'b' }>(template: T): [T, any, any];
    
    // Test the specific problematic case that should now work
    const [, , works1] = foo({ dataType: 'a', day: 0 });
    const [, , works2] = foo({ dataType: 'b', extra: 'value' });
    
    // Test assignment destructuring (not currently fixed)
    let a: any;
    [, , a] = foo({ dataType: 'a', day: 0 }); // This might still error
    
    // Test that legitimate errors are still caught
    const [, , fails1] = foo({ dataType: 'c' }); // Error: 'c' not assignable to 'a' | 'b'
                               ~~~~~~~~
!!! error TS2322: Type '"c"' is not assignable to type '"a" | "b"'.
!!! related TS6500 excessPropertyCheckingInArrayDestructuring.ts:1:34: The expected type comes from property 'dataType' which is declared here on type '{ dataType: "a" | "b"; }'
    const [, , fails2] = foo(123); // Error: number not assignable to constraint
                             ~~~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type '{ dataType: "a" | "b"; }'.
    
    // Test that non-destructuring cases work as before
    const result = foo({ dataType: 'a', day: 0 }); // Should work
    const explicit: [{ dataType: 'a', day: number }, any, any] = foo({ dataType: 'a', day: 0 }); // Should work
    
    // Test that other destructuring patterns work correctly
    const [first] = foo({ dataType: 'a', day: 0 }); // Should work
    const [, second] = foo({ dataType: 'a', day: 0 }); // Should work