Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeVarTuple causes mypy crash #17127

Closed
kdkavanagh opened this issue Apr 15, 2024 · 0 comments · Fixed by #17431
Closed

TypeVarTuple causes mypy crash #17127

kdkavanagh opened this issue Apr 15, 2024 · 0 comments · Fixed by #17431
Labels
crash topic-pep-646 PEP 646 (TypeVarTuple, Unpack)

Comments

@kdkavanagh
Copy link

Crash Report

mypy crashes when it encounters an overload signature containing a TypeVarTuple like:

@overload
    def cast(
        self, typ: type[MyType[SomeOtherTypeVar, *TheTupleTs]]
    ) -> MyType[SomeOtherTypeVar, *TheTupleTs]: ...

Traceback

error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.9.0
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 5742, in accept
  File "mypy/nodes.py", line 1904, in accept
  File "mypy/checkexpr.py", line 476, in visit_call_expr
  File "mypy/checkexpr.py", line 605, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 1443, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 1549, in check_call
  File "mypy/checkexpr.py", line 2633, in check_overload_call
  File "mypy/checkexpr.py", line 2979, in union_overload_result
  File "mypy/checkexpr.py", line 2816, in infer_overload_return_type
  File "mypy/checkexpr.py", line 1538, in check_call
  File "mypy/checkexpr.py", line 1723, in check_callable_call
  File "mypy/checkexpr.py", line 2136, in infer_function_type_arguments
  File "mypy/expandtype.py", line 68, in expand_type
  File "mypy/types.py", line 859, in accept
  File "mypy/expandtype.py", line 263, in visit_type_var_tuple
NotImplementedError:

Your Environment

  • Mypy version used: 1.9.0
  • Mypy command-line flags: mypy --install-types --show-traceback --non-interactive src/$(PACKAGE_NAME)
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.11.7
  • Operating system and version: rhel8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash topic-pep-646 PEP 646 (TypeVarTuple, Unpack)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants