Bug Report
mypy applies type checks when passing an unpacked tuple to a function, but it seems to skip the checks when passing a variable that is a union of tuple types.
To Reproduce
definner(_name: str, _num: int) ->None:
...
# mypy passes as expecteddeffun1(name_and_num: tuple[str, int]) ->None:
inner(*name_and_num)
# mypy errors as expecteddeffun2(name_and_num: tuple[str, float]) ->None:
inner(*name_and_num)
# mypy passes *but should error*deffun3(name_and_num: tuple[str, int] |tuple[str, float]) ->None:
inner(*name_and_num)
https://gist.github.com/mypy-play/257f0a56dd44b405b2853e2854333cc2
Expected Behavior
arg-type error on line 14
Actual Behavior
No error on line 14
Your Environment
- Mypy version used: 1.5.1
- Python version used: 3.11.5
Bug Report
mypyapplies type checks when passing an unpacked tuple to a function, but it seems to skip the checks when passing a variable that is a union of tuple types.To Reproduce
https://gist.github.com/mypy-play/257f0a56dd44b405b2853e2854333cc2
Expected Behavior
arg-typeerror on line 14Actual Behavior
No error on line 14
Your Environment