← Quit0 / 0 correct
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');
}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');
}