Skip to content

Crash on type alias bounded by and defaulted to itself #21128

@MeGaGiGaGon

Description

@MeGaGiGaGon

Crash Report

Found while messing around.

Traceback

Collapsed for readability
Deferral trace:
    __main__:1
    __main__:1
    __main__:1
    __main__:-1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:-1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
<string>: error: INTERNAL ERROR: maximum semantic analysis iteration count reached

To Reproduce

https://mypy-play.net/?mypy=master&python=3.14&gist=20fd30ebe61db2c71150e54a6c86a1bb

type A[T: A = A] = int
PS > uvx mypy@https://github.com/python/mypy.git --show-traceback -c 'type A[T: A = A] = int'

Your Environment

  • Mypy version used: Current master
  • Mypy command-line flags: --show-traceback -c "code"
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.14? Whatever uvx does.
  • Operating system and version: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions