Skip to content
New issue

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

Anonymous union variants #102

Open
domn1995 opened this issue Jan 6, 2023 · 0 comments
Open

Anonymous union variants #102

domn1995 opened this issue Jan 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@domn1995
Copy link
Owner

domn1995 commented Jan 6, 2023

Some times we want to make a very basic union without naming its variants. We should be able to do something like:

public partial record struct Number : Union<int, double>;

This would enable us to do the following:

var integer = new Number.Int();
var @double = new Number.Double();

Should it support generics?
Should it require you to name its variants or infer from the type name?

@domn1995 domn1995 added the enhancement New feature or request label Jan 6, 2023
@domn1995 domn1995 changed the title Anonymous union members Anonymous union variants Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant