Added Maybe type
commit6ee7638213944324cce8779775810fb0b6d06841
authorThomas Leonard <talex5@gmail.com>
Wed, 17 Sep 2008 19:25:19 +0000 (17 20:25 +0100)
committerThomas Leonard <talex5@gmail.com>
Wed, 17 Sep 2008 20:14:23 +0000 (17 21:14 +0100)
treec562c78320c9969eec6fbac54dafb15b3e8336ad
parentd856e0a8d1a549b722f71fa25600687ff40d5e46
Added Maybe type

The idea here is that pointers that can be null have a different type.
A normal class type cannot be null by default. Add a ? to the type to
indicate that it may be null. e.g. this method can only be called with
a non-null name, and never returns null:

Person lookup(char[] name):
...

This method can take and return nulls:

Person? lookup(char[]? name):
...
d-glue.cc
dmd/class.c
dmd/declaration.c
dmd/declaration.h
dmd/idgen.c
dmd/mtype.c
dmd/mtype.h
dmd/parse.c
dmd/typinf.c