QuizNot attempted
Where never appears
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
never
- Each
casenarrowssby itskind - once both union members are handled nothing is left, so in
defaultthe type isnever. - Writing
const _exhaustive: never = sturns 'someone added a kind' into a compile error. - Not Shape: narrowing has already removed both members.
- Not unknown: narrowing removes types, it never widens to the top type.
- Not { kind: string }: TS doesn't invent a widened shape for unhandled cases.