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

Mypy crash on calling typeclass with zero args #270

Closed
sobolevn opened this issue Jul 12, 2021 · 0 comments · Fixed by #273
Closed

Mypy crash on calling typeclass with zero args #270

sobolevn opened this issue Jul 12, 2021 · 0 comments · Fixed by #273
Labels
bug Something isn't working

Comments

@sobolevn
Copy link
Member

This code:

@typeclass
def some(instance) -> int:
    ...

reveal_type(some())

produces a crash:

ex.py:15: 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: 0.910
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 3905, in accept
  File "mypy/checkexpr.py", line 271, in visit_call_expr
  File "mypy/checkexpr.py", line 353, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 858, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 934, in check_call
  File "mypy/checkexpr.py", line 820, in transform_callee_type
  File "mypy/checkexpr.py", line 791, in apply_method_signature_hook
  File "mypy/checkexpr.py", line 762, in apply_signature_hook
  File "mypy/checkexpr.py", line 794, in <lambda>
  File "/Users/sobolev/Documents/github/typeclasses/classes/contrib/mypy/features/typeclass.py", line 277, in call_signature
    passed_type = ctx.api.expr_checker.accept(ctx.args[0][0])  # type: ignore
IndexError: list index out of range
ex.py:15: : note: use --pdb to drop into pdb
@sobolevn sobolevn added the bug Something isn't working label Jul 12, 2021
sobolevn added a commit that referenced this issue Jul 13, 2021
sobolevn added a commit that referenced this issue Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant