Implement Interface Using Super

Steven Schveighoffer schveiguy at gmail.com
Mon Jan 28 22:17:56 UTC 2019


On 1/28/19 3:28 PM, Jonathan Levi wrote:
> On Sunday, 27 January 2019 at 09:31:46 UTC, bauss wrote:
>> On Sunday, 27 January 2019 at 05:37:57 UTC, Jonathan Levi wrote:
>>> This works in LDC *but not* DMD?
>>> . . .
>>> Is this a bug in DMD *or* in LDC?
>>
>> There is no bug here.
> 
> So... LDC is the one that is bugged?

Yeah, that's odd. It should be the same result, as they both have the 
same semantics for the front end.

I'll defer to an LDC developer to answer that, but in truth, it really 
should be the way LDC implements it, even if that's not how the language 
spec is.

> I think it would have been nice to have a way of explicitly use the 
> super method to implement an interface without having to rewrite the 
> whole signature.  I thought I remember seeing a way once, but I must 
> have been dreaming.

I agree.

BTW, the typeof(super) requirement is super-annoying. alias x = super.x; 
is clear, I don't see why we need to specify typeof(super) in this 
context at least.

-Steev


More information about the Digitalmars-d-learn mailing list