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

Use of Annotated[T, ...] in a recursive type results in a segmentation fault #17220

Open
LeeeeT opened this issue May 6, 2024 · 0 comments
Open
Labels

Comments

@LeeeeT
Copy link

LeeeeT commented May 6, 2024

The following code causes mypy to never terminate.

from typing import Annotated, TypeVar


T = TypeVar("T")

R = Annotated[T, ...]

A = R["A"]

It can be turned into a sample that causes a segmentation fault.

from typing import Annotated, TypeVar


T = TypeVar("T")

R = Annotated[T, ...]

A = list[R["A"]]


def f() -> A:
    return []
  • Mypy version used: 1.10.0
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: 3.12
  • Operating system and version: Linux, Windows (on Windows it immediately exits with code 1)
@LeeeeT LeeeeT added the crash label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant