proposed @noreturn attribute

Meta via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 9 13:24:29 PDT 2017


On Sunday, 9 July 2017 at 19:30:25 UTC, Meta wrote:
> I thought some more about the ramifications of having a Bottom 
> type in D. Having a special type like this interacts badly with 
> most aspects of D's generic programming capabilities, even on 
> the simplest level. At the least we would probably have to 
> create special cases everywhere in the compiler and/or 
> libraries that check if the type we're working with is the 
> bottom type. A few simple cases I can think of off the top of 
> my head:
>
> alias Bottom = typeof(assert(0)); //for convenience
>
> Bottom*  pb; //Must be statically disallowed as this makes no 
> sense
> Bottom[] ab; //ditto
> cast(Bottom)1; //ditto

Another case that we should probably just statically disallow:

alias ImmutableBottom = immutable Bottom; //Ditto for shared, 
const, etc.

This obviously doesn't make any sense anyway.



More information about the Digitalmars-d mailing list