You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like discussed in #705, there is a need for type narrowing in the form of joining two or more types together in specific if-statement or conditional branches. To allow for this feature to work, there needs to be type joining i.e. all the types being joined together to form a more narrowed type than any single part. This is different from unions, as unions give options for types, while they are mixed together meaning something can be str | obj but not both at the same time.
Is there an existing proposal for this?
This feature does not exist in the latest version
Proposal
Like discussed in #705, there is a need for type narrowing in the form of joining two or more types together in specific if-statement or conditional branches. To allow for this feature to work, there needs to be type joining i.e. all the types being joined together to form a more narrowed type than any single part. This is different from unions, as unions give options for types, while they are mixed together meaning something can be
str | obj
but not both at the same time.For example:
Exact behaviour / changes you want
T1 & T2 & T3 ... Tn
.Related issues
The text was updated successfully, but these errors were encountered: