- Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
def f(t: TypeExpr[T]) -> T: ... reveal_type(f(int | str)) # int | str a: TypeExpr[int | str] a = int | str # valid UnionType a = int # valid int a = 1 # valid, bare literal a = object # invalid, object isn't a subtype of int | strI can imagine a lot of cases where there is ambiguous stuff like t: TypeExpr[Any], so we can just ban those ones.