views
ans
TypeScript discriminated union narrows in if but not in switch — exhaustiveness check fails