Closed
Description
Bug Report
When using a pipe to create a type alias error: Type application has too many types (1 expected)
is raised. This is not the case if you use a Union.
To Reproduce/Actual Behavior
from typing import Union
type_alias1= tuple[int, int, int] | int # error: Type application has too many types (1 expected)
type_alias2 = Union[tuple[int, int, int], int] # passes type check
My Environment
- Mypy versions used: 0.960+dev.10ba5c1aa14e01be1cfacb322136e22751617d26, and 0.942
- Python version used: Python 3.10.2
- Operating system and version: Windows 10 Home (21H2)
Metadata
Metadata
Assignees
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]false positive "error: Type application has too many types (1 expected)" when using pipe instead of Union for TypeAlias..[/-][+]false positive "error: Type application has too many types (1 expected)" when using pipe instead of Union for type alias.[/+]JelleZijlstra commentedon Apr 16, 2022
Duplicate of #11098
TypeAlias
with new union syntax (PEP 604) #11098