DMD Symbol Reference Analysis Pass

via Digitalmars-d digitalmars-d at puremagic.com
Wed May 27 07:13:01 PDT 2015


On Wednesday, 27 May 2015 at 11:02:24 UTC, Per Nordlöw wrote:
> On Wednesday, 27 May 2015 at 10:53:48 UTC, Per Nordlöw wrote:
>> On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote:
>>> Yes. First of all, `File.byLine.front` is the function that 
>>> needs to get annotated, like this:
>>>
>>>   char[] front() return {
>>>       // ...
>>>       return buffer;
>>>   }
>>>
>>> The `return` keyword here means the same thing as in DIP25,
>>
>> Is this supportd in 2.067 with -dip25 flag?
>>
>> If so shouldn't we qualify `File.byLine.front` with return 
>> when DIP-25 becomes stable?
>
> I qualified `front` with `return` here
>
> https://github.com/nordlow/justd/blob/master/bylinefast.d#L84
>
> but compiling this with DMD 2.067 along with flag -dip25 
> doesn't complain about
>
> https://github.com/nordlow/justd/blob/master/bylinefast.d#L188
>
> Did you mean that this too is a planned feature?

I general, `return` is supposed to work (with -dip25), but only 
in combination with `ref`, not slices or pointers. DMD probably 
ignores it here instead of printing an error message.


More information about the Digitalmars-d mailing list