C# 15 preview: union types, closed hierarchies and labeled break
C# 15 will add union types that combine a fixed set of types without inheritance or interfaces, plus closed hierarchies that block inheritance from other assemblies. Labeled break and continue statements also simplify exiting nested loops.
- Union types enable exhaustive switch without a default branch
- The closed keyword prevents inheritance from other assemblies
- Labeled break and continue remove the need for flag variables
Read next
Software