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

Imperatorn johan_forsberg_86 at hotmail.com
Sat Oct 16 09:21:45 UTC 2021


On Saturday, 16 October 2021 at 04:04:29 UTC, Paul Backus wrote:
> 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.

Yes. Many other languages take that approach


More information about the Digitalmars-d mailing list