dunet icon indicating copy to clipboard operation
dunet copied to clipboard

Anonymous union variants

Open domn1995 opened this issue 2 years ago • 0 comments

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 avatar Jan 06 '23 04:01 domn1995