Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is logically sound, but pragmatically not so. I wish the compiler could issue a warning or even an error if an expression of type `never` is used in a logical condition, like that of an `if`. While such cases might have rare legitimate uses (e.g. some edge cases of macro expansion, etc), I'd like it to be marked explicitly, similar to `unsafe`, e.g. with some `allow_never_as_condition` marker.

Likely the same should apply to expressions of type `()`.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: