We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Never
a: int & str reveal_type(a) # int & str, should be Never
The text was updated successfully, but these errors were encountered:
Or maybe an error?
Maybe an error if the resulting type is Never, but sections of a type could just evaporate away.
Sorry, something went wrong.
@final
As observed in #469 by @zevbo
from enum import Enum from typing import Generic, Literal, TypeVar class E(Enum): A = 0 B = 1 T = TypeVar("T", Literal[E.A], Literal[E.B]) class A(Generic[T]): pass class B(A[Literal[E.A]]): pass class C(A[Literal[E.B]]): pass TheUnion = B | C def a(b: A[E.A] & TheUnion) -> B: return b # Incompatible return value type (got "A[E.A] & B | C", expected "B") [return-value]
Successfully merging a pull request may close this issue.
The text was updated successfully, but these errors were encountered: