proposed @noreturn attribute

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 9 15:35:07 PDT 2017


On 07/09/2017 06:32 PM, Andrei Alexandrescu wrote:
> On 07/09/2017 03:30 PM, Meta wrote:
>> alias Bottom = typeof(assert(0)); //for convenience
> 
> Speaking of which, I think we shouldn't give it a name, same as 
> typeof(null). Just keep it typeof(assert(0)). Then wherever it occurs it 
> is immediately clear it has a special status requiring a second look 
> (which it does). -- Andrei

And btw this is technically a breaking change because somebody somewhere 
is liable to write code like:

void fun()
{
    ...
    return assert(0);
}

I'm not too worried about it though, and in fact we may even still 
accept it because hey typeof(assert(0)) converts to anything so how 
about it even converts to void.


Andrei


More information about the Digitalmars-d mailing list