Beta The Briev beta is out. Free on iPhone via TestFlight — install it in under a minute.

Join the beta ↗
Briev
Live
Technology

Microsoft plans November release of C# 15 with union types and safety upgrades

Microsoft announced that C# 15 will arrive in November, introducing union types and tighter memory-safety controls.

Microsoft is set to ship the next version of its C# language in November, following a recent preview that highlighted several major enhancements. Among them, union types—already present in languages like Python and TypeScript—allow a collection of custom types such as "Dog," "Cat," and "Bird" to be treated as a single, immutable umbrella type, improving pattern matching and reducing error-handling code. The language also introduces closed hierarchies, using a new keyword to limit subclassing to types defined within the same assembly, thereby preventing third-party extensions.

Additionally, the unsafe keyword’s scope is broadened to inform callers of required safety obligations, enabling the compiler to detect unsafe patterns more aggressively. In a demonstration, Mads Torgersen and Dustin Campbell showed how a union can merge success and failure record types into one switch expression, avoiding extra wrappers or external libraries. These features complement other C# 15 additions such as collection expression arguments, indexed extension blocks, and labeled break/continue statements. Developers can test the new capabilities by downloading a preview of.NET 11.

Why it matters

The update gives developers stronger type safety and less boiler-plate, streamlining code for modern applications.

In this story

C# 15union typesclosed hierarchiesunsafe keywordNET 11pattern matchingmemory safety
Get the beta ↗