Hacker News new | ask | show | jobs
by Ygg2 316 days ago
> «inline else» is also very powerful tool to easily abstract away code with no runtime cost.

Sure, but you lose the clarity of errors. The error wasn't in `comptime unreachable` but in `inline .a .b .c`.

2 comments

I disagree, I would say the error is in "comptime unreachable" or maybe the whole "switch (ab)".
`comptime unreachable` isn't the underlying cause and not the place you should fix in this case. A good error tells you what caused it, and where to fix it.
Adding a new case is legitimate, failing to handle it (by reaching unreachable) is an error.