exhaustive switch

A switch that the compiler has proven handles every possible value, so it needs no default branch.

In more detail

Exhaustiveness works for enums and sealed types, whose full set of values is known. Leaving out a case is a compile error, so adding a new variant forces every mapping to be updated. A default branch would hide that obligation, which is why the course omits it.

Related terms

Taught in

References

Certification courses