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?
This gives more meaningful error messages, with a function that actually does something - and resembles the matching pattern from functional languages quite well. 👍
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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. 👍