In the default branch of a switch over a discriminated union,
#typescript narrows the value down
to never - but only once every other case is handled. Pass it to a
function typed (x: never) and that guarantee becomes load-bearing:
add a variant, miss a case, and the code stops compiling.
@itsnas TypeScript
main
Nas (@itsnas)