proposed @noreturn attribute

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 8 13:09:35 PDT 2017


On 7/8/2017 5:17 AM, Andrei Alexandrescu wrote:
> None ThisFunctionExits();
> 
> The compiler detects (without having anything hardwired about the particular 
> type "None") that the type None is impossible to create and copy/move from a 
> function, and therefore decrees the function will never return.

That is a scathingly brilliant idea. It has another nice effect - the compiler 
doesn't have to diagnose:

    @noreturn int foo();

as an error!

Me like.


More information about the Digitalmars-d mailing list