Introducing Nullable Reference Types in C#. Is there hope for D, too?

Walter Bright newshound2 at digitalmars.com
Mon Nov 20 22:56:44 UTC 2017


On 11/20/2017 3:27 AM, Timon Gehr wrote:
> On 20.11.2017 11:07, Atila Neves wrote:
>> The problem with null as seen in C++/Java/D is that it's a magical value that 
>> different types may have. It breaks the type system.
> 
> In Java, quite literally so. The Java type system is /unsound/ because of null. 
> (I.e. Java is only memory safe because it runs on the JVM.)

I'm curious. Can you expand on this, please?

(In D, casting null to any other pointer type is marked as @unsafe.)


More information about the Digitalmars-d mailing list