ref is unsafe

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jan 2 15:37:14 PST 2013


On 1/2/13 5:21 PM, Maxim Fomin wrote:
> On Wednesday, 2 January 2013 at 19:37:51 UTC, Jonathan M Davis wrote:
>> On Wednesday, January 02, 2013 13:45:32 Maxim Fomin wrote:
>>> I think it should not be fixed, but probably compiler may issue
>>> warning at some circumstances when it can realize this situation.
>>
>> It's a hole in @safe. It must be fixed. That's not even vaguely up for
>> discussion. The question is _how_ to fix it. Ideally, it would be
>> fixed in a way
>> that limits how much more code has to become @system.
>
> I argue that @safity can be easily broken (not only by example I
> provided) and there is no way to fix all holes because D is a system
> language and provides access to low-level features. @Safe is good to
> warn about (not prevent from) doing something wrong but it cannot stop
> from all safety breakages.

That is incorrect.

Andrei


More information about the Digitalmars-d mailing list