mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 12:32:08 -06:00
Modified getTypeFromArrayBindingPattern to make contextual type construction agnostic to whether tuple destructuring elements have binding names. When includePatternInType is true, cap minLength at 2 to ensure consistent contextual types regardless of binding pattern variations. This fixes an issue where [, , t] and [, s, ] produced different contextual types, causing inconsistent generic type inference and spurious excess property errors. Addresses feedback in #41548 about making contextual types position-agnostic. Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>