Skip to content

Crash upon unpacking undefined name during subclassing #19960

@bzoracler

Description

@bzoracler

Crash Report & To Reproduce

In the following, tuple[*TS] is a typo (it's supposed to be tuple[*Ts]. See mypy Playground:

class MyTuple[*Ts](tuple[*TS]):
    ...

The typo should report a name-defined error; currently, mypy crashes without reporting the error beforehand.

Traceback

Traceback (most recent call last):
  ...
  File "mypy/semanal_shared.py", line 306, in calculate_tuple_fallback
NotImplementedError

Your Environment

  • Mypy version used: 1.18.2, master
  • Mypy command-line flags: None
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.12, 3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions