The story’s score and claims

Comments on No. 5 of 95 · cekrem.github.io · edition of Tuesday 10 November 2026

C# 15: Union Types, Closed Hierarchies, and the Unique One Value

Summary

Christian Ekrem tried C# 15's new union keyword and closed classes on the .NET 11 release candidate. Switch expressions over a union are exhaustive, but a missing case only raises warning CS8509 unless made an error, and switch statements get no check. Because a union compiles to a struct, default holds a null that no case matches, so the documentation advises a null arm. He also found value types boxed, no built-in Result type, and System.Text.Json failing to deserialize unions. Several findings rest on his own runs.

Comments

Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules