Throws for unreachable branches in discriminated unions.
Exhaustiveness-check value that should be typed never when all union cases are handled.
never
Never — always throws.
switch (status.kind) { case "idle": case "loading": case "done": break; default: assertNever(status.kind);} Copy
switch (status.kind) { case "idle": case "loading": case "done": break; default: assertNever(status.kind);}
Always, with a message that includes the unexpected value.
Throws for unreachable branches in discriminated unions.