Feedback Thread: DIP 1034--Add a Bottom Type (reboot)--Community Review Round 1

Dennis dkorpel at gmail.com
Tue May 19 21:39:53 UTC 2020


On Saturday, 16 May 2020 at 16:04:25 UTC, Piotr Mitana wrote:
> We need to state the underlying type explicitely. Bottom type 
> would allow us to use

Thank you for the suggestion. I don't use Nullable, so I cannot 
relate to the situation you are describing. I can still include 
the example, but I need these things cleared up:
- Nullable!nothing does not implicitly convert to Nullable!T 
right? It would require an alias this.
- Using `null_` seems bad for readability, since it's unclear it 
is supposed to be `null` for the Phobos Nullable type instead of 
any other library nullable / optional types. Can't you define an 
opAssign that accepts the actual `typeof(null)`?
- D has no implicit construction so that still would not work in 
a constructor. Do you often find yourself wanting to initialize 
Nullable members to null with a constructor? Maybe you can get 
around to it with overloads / default parameters / factories 
depending on the use case, but (again) I'm not a user of Nullable 
so I'm not sure. An example of a struct/class with nullable 
members 'in the wild' would be appreciated.

(If you reply to this, don't forget to do it in the discussion 
thread)


More information about the Digitalmars-d mailing list