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

Ola Fosheim Grøstad ola.fosheim.grostad+dlang at gmail.com
Mon Nov 20 11:39:39 UTC 2017


On Monday, 20 November 2017 at 11:27:15 UTC, Timon Gehr wrote:
> On 20.11.2017 11:07, Atila Neves wrote:
>> 
>> 
>>> As you can guess, I happen to like null, because there are no 
>>> hidden bugs from pretending it is a valid value - you get an 
>>> immediate program halt - rather than subtly corrupted results.
>> 
>> 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.)

Are you thinking about this?

https://dl.acm.org/citation.cfm?id=2984004

I don't think it says that it is unsound because of null, but 
that later features came in conflict with it?



More information about the Digitalmars-d mailing list