loading...

re: Exhaustive Type Checking with TypeScript! VIEW POST

FULL DISCUSSION
 

The error message you get with this "trick" is only useful if you know why you're getting it - adding a function just for the purposes of triggering a confusing compiler error?

I like this approach better:

dev.to/housinganywhere/matching-yo...

This gives more meaningful error messages, with a function that actually does something - and resembles the matching pattern from functional languages quite well. 👍

Code of Conduct Report abuse