Giorgi Kobaidze's C# 15 Unpacked: Closed Hierarchies, the Members-Only Club for Your Classes uses an order status model to show how a library can tell the compiler that every direct case of a base type is known. The article starts with pending, shipped, and delivered states, then asks what happens to the code that describes an order when someone adds a returned state.
Make a new case visible during the build
With an ordinary abstract record, a switch expression that handles those three states can still receive a value from another subclass. Adding a discard arm that throws satisfies the coverage check, and a newly added state can then reach that arm at runtime. Kobaidze shows how a closed base record changes the same switch. Once its arms cover each direct subclass, the compiler can check coverage without a discard arm.
The maintenance payoff comes when the team adds the returned state. On recompilation against the updated hierarchy, a consumer using the original three-arm switch can receive a non-exhaustive switch warning. A team that relies on this signal can check whether its build treats that warning as an error. A general fallback arm already covers the new state, so it won't give the same prompt to revisit the mapping.
Decide which level of the hierarchy can grow
A closed class or record is implicitly abstract, and its direct subclasses have to live in the same assembly. A public closed type remains available to consumers for use and pattern matching. Kobaidze points out that a public, unsealed direct subclass can still be extended elsewhere. In his example, an express shipment fits the existing shipped arm because the new type inherits from the shipped case.
That gives library authors a way to keep the top-level cases complete while giving one branch room to grow. A consumer that handles all shipments together can match the shipped type once. A consumer that needs separate behavior for kinds of shipment should check whether that branch makes its own completeness guarantee. Microsoft's closed modifier reference describes the same-assembly rule and how it applies to switch coverage.