type Dir = 'N' | 'S' | 'E' | 'W'
// switch with default assigned to never
// will cause a compile error if any member is unhandledAn exhaustive switch assigns the default to never, causing a compile error if a union member is unhandled.
A switch over a discriminated union's type field is exhaustive when all cases are handled.
Challenge: Implement processStatus(status) for all three union variants.
processStatus({ type: 'ok', value: 'data' }) // β 'OK: data'
processStatus({ type: 'error', message: 'not found' }) // β 'Error: not found'
processStatus({ type: 'pending' }) // β 'Pending'