proposed @noreturn attribute

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 10 06:47:35 PDT 2017


On 2017-07-09 23:14, H. S. Teoh via Digitalmars-d wrote:

> I like out{ assert(0); } for pretty much the same reasons as Steven
> lists. The biggest pro is that **the language already supports it*.
> Contract syntax already is meant to signal intent, and assert(0) signals
> "never gets here". You can't find a better solution than this. 

I highly doubt that the compiler does not need to be changed at all to 
get the wanted behavior.

It that case it's just as easy to add a compiler recognized UDA. It 
doesn't add any more baggage than "out{ assert(0); }".

With that said, I don't care that much at all and I'm questioning how 
useful this feature is to have at all.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list