bottom type as parameter or local variable, does that make sense?

Max Samukha maxsamukha at
Sat Jan 15 09:52:00 UTC 2022

On Saturday, 15 January 2022 at 00:54:03 UTC, Paul Backus wrote:
> Why does this exception exist? Because for any type `T` other 
> than `noreturn`, the expression `T.init` evaluates to a value 
> of type `T`. However, the expression `noreturn.init` does not 
> evaluate to a value of type `noreturn`--because, as previously 
> stated, *there is no such thing as a value of type `noreturn`*.

I understand the argument and counterarguments. I don't know what 
is the right way. I err on the side of not introducing the 
special case: every variable in D requires initialization, and 
initialization of noreturn should fail because the initializer 
halts. You argue that noreturn doesn't have a value, so we don't 
even need to evaluate the initializer. Tight corner.

More information about the Digitalmars-d mailing list