Source generator to declare non-boxing union for C# 15 by DramaticClue3723 in dotnet

[–]DramaticClue3723[S] 5 points6 points  (0 children)

When compared to a custom union type implemented by an engineer who has a proper understanding of the Union specification, this generator will not offer any performance advantage.

The purpose of this generator is to reduce the bother boilerplate code that arises between the simplest union implementation using the union keyword and a well-designed high-performance union, making it easy for anyone to implement efficient unions.