exhaustiveness

The property of a switch expression whose arms cover every possible input value, which the compiler checks for you.

In more detail

For an enum or other closed set of values, the compiler can list exactly which cases are missing. A non-exhaustive switch expression compiles with warning CS8509 and throws SwitchExpressionException if an unhandled value arrives at run time.

Related terms

Taught in

References