DIP 1017--Add Bottom Type--Final Review

Johannes Loher johannesloher at fg4f.de
Thu Jan 17 22:07:54 UTC 2019


Am 17.01.19 um 22:59 schrieb Neia Neutuladh:
> On Thu, 17 Jan 2019 12:15:20 -0800, H. S. Teoh wrote:
>> A better approach might be to make TBottom* always equal to null --
>> i.e., it's always illegal to dereference it because no instances of
>> TBottom can exist.
> 
> Dereferencing TBottom* would have to be rewritten as `assert(false);` to 
> make this type of illegal work with generic code.
> 
No, dereferencing an instance of type `Tbottom*` is always dereferencing
`null`, i.e. programm abbortion (which is not the same as `assert(0)`).


More information about the Digitalmars-d mailing list