fix: mention type aliases in "Type application" error message by nuglifeleoji · Pull Request #21122 · python/mypy

Fixes #20927.

The error message raised when type arguments are applied to a non-class expression (e.g. a generic function):

error: Type application is only supported for generic classes

is inaccurate because PEP 695 type aliases (type TA[T] = list[T]) also support type application (TA[int]). Updated to:

error: Type application is only supported for generic classes and type aliases

Updated mypy/message_registry.py (ONLY_CLASS_APPLICATION) and all matching test fixtures.

Made with Cursor