Skip to content
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

(🐞) Subscripted type with new union syntax in TypeAlias incorrectly reports 'Value of type "Type[type]" is not indexable' #12978

Closed
KotlinIsland opened this issue Jun 13, 2022 · 1 comment
Labels
bug mypy got something wrong topic-pep-604 PEP 604 (union | operator) topic-type-alias TypeAlias and other type alias issues

Comments

@KotlinIsland
Copy link
Contributor

from typing import TypeAlias, Union

A: TypeAlias = type[object] | object  # error: Value of type "Type[type]" is not indexable
B = type[object] | object  # error: Value of type "Type[type]" is not indexable

playground

@KotlinIsland KotlinIsland added the bug mypy got something wrong label Jun 13, 2022
@AlexWaygood
Copy link
Member

Duplicate of #12392

@AlexWaygood AlexWaygood marked this as a duplicate of #12392 Jun 13, 2022
@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2022
@AlexWaygood AlexWaygood added topic-pep-604 PEP 604 (union | operator) 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-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