If a new action type is added to the Action type that isn't handled by
the switch-case statement, the default case will become reachable and
TypeScript will report an error. This is becasue the first parameter of
UnreachableCaseError's constructor is typed as never and nothing can
be assigned (or passed) to something typed as never.
An thin wrapper around KindError which can be used to ensure exhaustiveness of switch-case statements
Param: value
The variable being refined by the switch-case statement.
Example:
If a new action type is added to the
Action
type that isn't handled by the switch-case statement, thedefault
case will become reachable and TypeScript will report an error. This is becasue the first parameter ofUnreachableCaseError
's constructor is typed asnever
and nothing can be assigned (or passed) to something typed asnever
.