[Proposal]: Union types #4730
Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
Moving to a discussion. As mentioned in the issue template:
|
Beta Was this translation helpful? Give feedback.
-
@savans2 Union types already being discussed for C# are where the possible values are not constants but are rather instances of a given set of types. A union type would look like The example given uses constant values, though ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Union types
Summary
In TypeScript we have union types where we can say that variable
status
can be only one of the following values"On" | "Off" | "Idle"
Motivation
Detailed design
Drawbacks
Alternatives
Unresolved questions
Design meetings
Beta Was this translation helpful? Give feedback.
All reactions