Disallow null references in safe code?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Feb 3 22:49:56 PST 2014


On 2/3/14, 10:22 PM, deadalnix wrote:
> 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.

No breakage if the opt-in flag is not used.

Andrei


More information about the Digitalmars-d mailing list