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

Incompletely defining a TypeAliasType causes mypy to crash #18307

Closed
bzoracler opened this issue Dec 18, 2024 · 0 comments · Fixed by #18308
Closed

Incompletely defining a TypeAliasType causes mypy to crash #18307

bzoracler opened this issue Dec 18, 2024 · 0 comments · Fixed by #18308
Labels
crash topic-pep-695 Issues related to PEP 695 syntax

Comments

@bzoracler
Copy link
Contributor

Crash Report, Reproduction, & Traceback

See mypy Playground. This causes usability issues with the mypy daemon, as the session would need to be relaunched with a long startup wait.

from typing_extensions import TypeAliasType

MyType = TypeAliasType("MyType")
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "mypy/semanal.py", line 7113, in accept
  File "mypy/nodes.py", line 1351, in accept
  File "mypy/semanal.py", line 3119, in visit_assignment_stmt
  File "mypy/semanal.py", line 3863, in check_and_set_up_type_alias
IndexError: list index out of range

main.py:3: 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.13.0
main.py:3: : note: use --pdb to drop into pdb

Your Environment

  • Mypy version used: 1.13
  • Mypy command-line flags: --show-traceback
  • Mypy configuration options from mypy.ini (and other config files): None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash topic-pep-695 Issues related to PEP 695 syntax
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants