"I told you so": noreturn sucks a leech and has virtually no utility

Paul Backus snarwin at gmail.com
Sat Oct 16 04:04:29 UTC 2021

On Saturday, 16 October 2021 at 02:56:02 UTC, H. S. Teoh wrote:
> On Sat, Oct 16, 2021 at 12:15:35AM +0200, Timon Gehr via
>> - It gives more static information to the compiler, 
>> exacerbating the
>>   issue of dead code warnings in generic code.
> But shouldn't dead code in generic code just be elided, instead 
> of eliciting warnings?

Unfortunately, the "statement is unreachable" warning cannot tell 
the difference between generic code and non-generic code, and has 
thus far resisted all attempts to teach it.

Personally I think removing it altogether would be a net gain for 
the language. If anyone really wants it, we can always implement 
it as a check in D-Scanner or some similar tool.

More information about the Digitalmars-d mailing list