On Saturday, 4 January 2014 at 12:37:34 UTC, ilya-stromberg wrote:
Have you got any plans to impove this situation?

I wrote a NotNull struct for phobos that could catch that situation. I don't think it got pulled though.

http://arsdnet.net/dcode/notnull.d

With @disable is becomes reasonably possible to restrict built in types with wrapper structs. It isn't perfect but it isn't awful either.

The big thing people have asked for before is

Object foo;
if(auto obj = checkNull(foo)) {
   obj == NotNull!Object
} else {
  // foo is null
}

and i haven't figured that out yet...

Reply via email to