proposed @noreturn attribute

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 10 10:48:29 PDT 2017


On Mon, Jul 10, 2017 at 03:47:35PM +0200, Jacob Carlborg via Digitalmars-d wrote:
> 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.

I did not say the compiler does not need to be changed. I said the
*language* does not need to be changed.


> 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.
[...]

As is usual around here, things of marginal consequence receive the most
attention and energy spent in debating every last nitpick. Sigh.


T

-- 
Unix was not designed to stop people from doing stupid things, because that would also stop them from doing clever things. -- Doug Gwyn


More information about the Digitalmars-d mailing list