ruff
e721ecef - [ty] Leave room for later positional arguments when unpacking a variable-length argument (#29293)

Commit
41 days ago
[ty] Leave room for later positional arguments when unpacking a variable-length argument (#29293) ## Summary This PR fixes a bug where unpacking something like `*args` would eat up all the remaining positional parameters. Because of this, if you passed another explicit argument *after* the unpack (like `f(*args, x)`), the type checker thought there was no space left for `x`. This caused false positive `too-many-positional-arguments` or `invalid-argument-type` errors. To fix this, we updated the logic in `bind.rs`. Now, if a function doesn't have a variadic parameter, we count how many explicit positional arguments come after the unpack and reserve room for them so everything fits properly. Part of: astral-sh/ty#3649. --------- Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Author
Parents
Loading