Skip to content

Segfault on recursive type #20227

@Randomneo

Description

@Randomneo

Crash Report

if replace tuple[Hashable | HashableArg] with tuple[Hashable | HashableArg, ...] no seg fault.

Traceback

199195 segmentation fault (core dumped)  mypy test.py

To Reproduce

from collections.abc import Hashable

type HashableArg = (
    dict[Hashable, Hashable | HashableArg]
    | tuple[Hashable | HashableArg]
)

Your Environment

  • Mypy version used: mypy 1.18.2
  • Mypy command-line flags: No
  • Mypy configuration options from mypy.ini (and other config files): No
  • Python version used: Python 3.13.7
  • Operating system and version: Linux 6.17.7-arch1-1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions