DIP 1017--Add Bottom Type--Final Review

Neia Neutuladh neia at ikeran.org
Tue Jan 15 17:22:16 UTC 2019


This part is quite terse and I'm not sure what the implications are:

> A function that returns a Tbottom is covariant with a function that
> returns any type T if T is returned via the registers or if the function
> returning Tbottom is overriding a function returning T.

Would this work?

    class C
    {
      override Tbottom toString() { assert(false); }
    }

It's implied that that would work, but using more words and examples for 
clarity would be nice.

Would this print `int function()[immutable(char)[]]`, as it does today?

    import core.stdc.stdlib : exit;
    int doStuff();
    auto actions = ["quit": &exit, "stuff": &doStuff];
    writeln(typeof(actions.stringof));

It's not implied that that would work, and I strongly suspect it would not 
-- that it would find `&exit` and assume the delegates need to return 
Tbottom, then error because `doStuff` doesn't.


More information about the Digitalmars-d mailing list