Re:TypeScript’s never type, what’s the point? (2019)
by aluminum96 on Tuesday September 21, 2021 @08:03PM
(#28611596)
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.
[ Parent
| on HN ]
Re:TypeScript’s never type, what’s the point? (2019)
by noduerme on Tuesday September 21, 2021 @09:29PM
(#28612174)
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'.
Re:TypeScript’s never type, what’s the point? (2019)
by christopherbalz on Wednesday September 22, 2021 @10:42AM
(#28616850)
+1 Also, the author of the article was able to do the job in an article that one can read in just a few minutes - a rare feat.