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:
This gives more meaningful error messages, with a function that actually does something - and resembles the matching pattern from functional languages quite well. 👍
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.