Disallow null references in safe code?

deadalnix deadalnix at gmail.com
Mon Feb 3 22:22:00 PST 2014


On Tuesday, 4 February 2014 at 06:03:14 UTC, Andrei Alexandrescu 
wrote:
> On 2/3/14, 9:09 PM, Jonathan M Davis wrote:
>> I truly hope that that's never the case. Adding non-nullable 
>> references to the
>> language is one thing; making them the default is quite 
>> another, and making
>> them the default would break existing code. And given Walter's 
>> normal stance
>> on code breakage, I'd be very surprised if he were in favor of 
>> making non-
>> nullable references or pointers the default.
>
> We are considering making non-nullables the default, @nullable 
> to mark optionally null objects, and enable the related checks 
> with an opt-in compiler flag.
>
> Andrei

That would be awesome. The breakage involved, is quite high 
however.


More information about the Digitalmars-d mailing list