.NET (OK, C#) finally gets union types🎉
Summary
Andrew Lock explains union types in .NET 11 preview 2 (C# 15), what union types are, and how to declare and use them with the union keyword. The post covers enabling language preview, basic usage with examples, and how the compiler generates code, including an IUnion interface and UnionAttribute. It also discusses boxing concerns and the option to implement custom, non-boxing unions.