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

AssertionError: unexpected type <class 'mypy.types.ParamSpecType'> #1051

Open
itamarst opened this issue Apr 12, 2024 · 0 comments
Open

AssertionError: unexpected type <class 'mypy.types.ParamSpecType'> #1051

itamarst opened this issue Apr 12, 2024 · 0 comments

Comments

@itamarst
Copy link

Consider the following module:

from typing import Callable, ParamSpec, TypeVar

_P = ParamSpec("_P")
_T = TypeVar("_T")

def execute(
    func: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs
) -> _T:
    return func(*args, **kwargs)

I can check it with mypy, but not compile it with mypyc:

$ mypy repro.py 
Success: no issues found in 1 source file
$ mypyc repro.py 
Traceback (most recent call last):
  File "mypyc/irbuild/builder.py", line 266, in accept
  File "mypy/nodes.py", line 787, in accept
  File "mypyc/irbuild/visitor.py", line 179, in visit_func_def
  File "mypyc/irbuild/function.py", line 99, in transform_func_def
  File "mypyc/irbuild/function.py", line 284, in gen_func_item
  File "mypyc/irbuild/env_class.py", line 102, in load_env_registers
  File "mypyc/irbuild/env_class.py", line 179, in add_args_to_env
  File "mypyc/irbuild/env_class.py", line 165, in num_bitmap_args
  File "mypyc/irbuild/builder.py", line 1233, in type_to_rtype
  File "mypyc/irbuild/mapper.py", line 153, in type_to_rtype
repro.py:6: AssertionError: unexpected type <class 'mypy.types.ParamSpecType'>

Versions:

Python 3.11.9
mypy 1.9.0 (compiled: yes)
mypyc 1.9.0 (compiled: yes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant