dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
242 stars 80 forks source link

assert(false) should be exempt from the assert message check #874

Open Moth-Tolias opened 2 years ago

Moth-Tolias commented 2 years ago

since assert(false) has the specific meaning of "unreachable code", it should be exempt from the assert message check as to add one would be needless repetition.

VPanteleev-S7 commented 1 month ago

I think the same rationale for why it makes sense to warn on missing messages for assert(condition) also applies to assert(false). In both cases, in debug builds, you'd get a nondescript "Assertion failure" message, which the linter rule exists to avoid. The only practical difference is what happens in -release builds, but that seems orthogonal to the aspects concerning the linter.