[D typesystem] What is the type of null?

Justin Johansson no at spam.com
Tue Oct 12 08:36:39 PDT 2010


On 13/10/2010 2:04 AM, Andrei Alexandrescu wrote:
> On 10/12/10 9:51 CDT, Adam D. Ruppe wrote:
>> I agree with what the compiler says: void*.
>>
>> null is literally a pointer into the void - there's nothing there
>> for it to point to.
>
> Problem:
>
> char[] a = null;
>
> The answer to the OP's question is simple: null's type is not
> expressible in D.
>

>
> Andrei

That is a sad observation for a language that purports
maturity beyond the epoch of C/C++/Java et. al.

Justin


More information about the Digitalmars-d mailing list