[Discussion]: Unions #9663
Replies: 6 comments 25 replies
-
*existing, I assume |
Beta Was this translation helpful? Give feedback.
-
What is the purpose for having the |
Beta Was this translation helpful? Give feedback.
-
Does exhautiveness work for "partial" unions (a "sub-union")?
A related question, can we return a sub-union?
|
Beta Was this translation helpful? Give feedback.
-
for my opinion add static multi-inheritance for struct other cases we can resolve with [Offsets] |
Beta Was this translation helpful? Give feedback.
-
What about this syntax, since C# has recently added the keyword union Pet allows Cat, Dog, Bird;
closed record Pet2 allows Cat, Dog, Bird; I feel no conflict having commas once the parens are gone, interestingly. |
Beta Was this translation helpful? Give feedback.
-
Isn't it possible to make a tagged union implementation behind the scenes when all of the cases are struct types, and maintain the same surface area? Basically, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Several union proposals were consolidated into one. Here is a place to discuss the one.
Proposal document:
https://github.com/dotnet/csharplang/blob/main/proposals/unions.md
Issue for proposal:
#9662
Beta Was this translation helpful? Give feedback.
All reactions