C# 15 adds union types with .NET 11
The author examines the new union types and closed hierarchies introduced in C# 15 alongside .NET 11, testing their exhaustiveness checking, pattern matching, and functional programming ergonomics. While finding that the feature brings powerful capabilities like railway-oriented programming closer to C#, the author notes practical limitations including lack of base Result libraries, struct default values yielding unexpected nulls, and type-based rather than tag-based case handling. Open article →