Skip to content

Unexpected "Type application has too many types" #12966

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

Closed
arnimarj opened this issue Jun 10, 2022 · 1 comment
Closed

Unexpected "Type application has too many types" #12966

arnimarj opened this issue Jun 10, 2022 · 1 comment
Labels
bug mypy got something wrong topic-pep-585 PEP 585 (builtin generics) topic-pep-604 PEP 604 (union | operator) topic-type-alias TypeAlias and other type alias issues

Comments

@arnimarj
Copy link

arnimarj commented Jun 10, 2022

Bug Report

I'm not sure if this is related to #12211, but I have this simple example:

from typing import Tuple, TypeAlias


class Foo:
	...


_A: TypeAlias = Foo | None | Tuple[str, str]
_B: TypeAlias = Foo | None | tuple[str, str]
_C = Foo | None | Tuple[str, str]
_D = Foo | None | tuple[str, str]

...which fails.

To Reproduce

Run the above using mypy --strict alias.py.

I tried both 0.961 and 0.970-dev using Python 3.10.5. I get these errors:

$ mypy --strict alias.py 
alias.py:9: error: Type application has too many types (1 expected)
alias.py:11: error: Type application has too many types (1 expected)
Found 2 errors in 1 file (checked 1 source file)

Your Environment

This was run on Ubuntu 22.04, Python 3.10.5, and mypy 0.961 and 0.970-dev

@arnimarj arnimarj added the bug mypy got something wrong label Jun 10, 2022
@AlexWaygood AlexWaygood added the topic-pep-604 PEP 604 (union | operator) label Jun 12, 2022
@AlexWaygood
Copy link
Member

Duplicate of #11098

@AlexWaygood AlexWaygood marked this as a duplicate of #11098 Jun 12, 2022
@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2022
@AlexWaygood AlexWaygood added topic-pep-585 PEP 585 (builtin generics) topic-type-alias TypeAlias and other type alias issues labels Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-pep-585 PEP 585 (builtin generics) topic-pep-604 PEP 604 (union | operator) topic-type-alias TypeAlias and other type alias issues
Projects
None yet
Development

No branches or pull requests

2 participants