Sealed Interfaces and Exhaustive Switch: Making Illegal States Unrepresentable
A compact, runnable example showing how sealed hierarchies plus pattern-matching switches turn a whole category of bugs into compile errors. “Make illegal states unrepresentable” i...