← Quit0 / 0 correct
JS / TypeScriptHard1 of 40

In an exhaustive switch over a discriminated union, why assign the value to a variable of type never in the default branch?

default: {
  const unreachable: never = shape;
  throw new Error('unhandled');
}