[D typesystem] What is the type of null?

Simen kjaeraas simen.kjaras at gmail.com
Tue Oct 12 08:30:41 PDT 2010


On Tue, 12 Oct 2010 15:52:36 +0200, Justin Johansson <no at spam.com> wrote:

> Given that if a function should return something,
> and that function may return null in, at least
> reference type return scenarios, one would expect that
> "null" has a type.
>
> What is the type of "null" in the D typesystem?

The type of null is Null. This type is castable to any pointer or
reference type, as well as arrays.

Now, this is of course not true, but it could have been.

-- 
Simen


More information about the Digitalmars-d mailing list