Returning dynamic array from the function

Timon Gehr timon.gehr at gmx.ch
Wed Oct 17 14:41:20 PDT 2012


On 10/17/2012 10:15 PM, sclytrack wrote:
> On Wednesday, 17 October 2012 at 19:46:51 UTC, bearophile wrote:
>> sclytrack:
>>
>>> It doesn't give an error when marking the function with safe.
>>>
>>> @safe
>>> int[] create()
>>> {
>>> }
>>
>> I think marking it @safe is not relevant. In theory a good type system
>> should give an error message on similar code. I don't know if D is
>> supposed to spot similar error situations.
>>
>> Bye,
>> bearophile
>
> If that's the case then they should call it safeR D instead of safe D.

I think what he meant to say was that it should be illegal to do this
even in @system code, not that it is OK that it passes with @safe.


More information about the Digitalmars-d-learn mailing list