Bottom Type--Type Theory

Johannes Loher johannesloher at fg4f.de
Thu Jan 17 21:37:37 UTC 2019


Am 17.01.19 um 22:29 schrieb Neia Neutuladh:
> On Thu, 17 Jan 2019 21:48:52 +0100, Johannes Loher wrote:
>> I don't actually think declaring a variable of the Bottom type is
>> required to be illegal. It just needs to be impossible for it to ever be
>> initialized.
> 
> Which runs into default-initialization, so that's not awesome. But the 
> same is true of structs with `@disable this();`
> 
> If we treated them the same, you'd still be able to write:
> 
>     TBottom var = void;
>     doStuff(var);
> 
> That's...not awesome.
> 
Both default initialization and void initialization of variables of type
Tbottom would need to be illegal. The _only_ way to "initialize" them
would be by copying, which—as explained—means they are never actually
initialized.


More information about the Digitalmars-d mailing list