I thought this was a pretty good explanation of why TypeScript has a `never` type. I always see it used in conditional and mapped types, but didn't understand why the language had it to begin with.
Agreed. I never saw the utility of it really until reading this today. I can't think of many situations where I've relied on exhaustively checking union types in a switch case, but there are probably a couple that could be tightened up with 'never'.
3 comments
[ 4.6 ms ] story [ 22.5 ms ] thread