dip25 implementation

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 6 14:18:13 PDT 2015


On 8/6/15 4:11 PM, Xiaoxi wrote:
> On Thursday, 6 August 2015 at 19:55:20 UTC, Steven Schveighoffer wrote:
>> On 8/4/15 4:54 PM, Steven Schveighoffer wrote:
>>> How complete is the dip25 implementation?
>>>
>>> For example, should this be expected to be an error?
>>>
>>> struct S
>>> {
>>>    int[5] x;
>>>    auto foo() { return x[];}
>>> }
>>>
>>> I'll note, that dmd 2.067.0 with -dip25 considered this an error, head
>>> does not. Adding a 'return' to the foo attributes fixes it in 2.067,
>>> but...
>>>
>>> auto getS()
>>> {
>>>     S s;
>>>     return s.foo();
>>> }
>>>
>>> does not error in either version, even with the return attribute.
>>
>> Anyone? Is this a bug or not?
>>
>
> why is it related to dip25? slices uses pointers not ref?

I think it's because the 'this' is implicitly ref. If dip25 just throws 
its hands up on slicing, it has a problem I think.

In any case, 2.067 complained about it with -dip25, and didn't without, 
so it seems related.

-Steve


More information about the Digitalmars-d mailing list