bad-argument-count false positive with unpacking
Open
google
needs-discussion
stale
typechecking
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 519
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
Reproducer:
```
def f(x, y, z): ...
def test(xs: list[int]):
f(*xs[-4:-2], 42)
```
Output:
```
ERROR Expected 3 positional arguments, got 4 in function `f` [bad-argument-count]
--> /tmp/foo.py:4:17
|
4 | f(*xs[-4:-2], 42)
| ^^
|
INFO 1 error
```
Even though `xs[-4:-2]` has no more than 2 elements (with indices -4 and -3).
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.