Inheritance from multiple interfaces with the same method name

Adam D. Ruppe destructionator at gmail.com
Thu Dec 7 15:14:48 UTC 2017


On Thursday, 7 December 2017 at 00:45:21 UTC, Mike Franklin wrote:
>     // Error: A.f called with argument types () matches both: 
> A.f() and A.f()
>     // Yeah, that error message could be better.
>     //a.f();
>
>     (cast(I)a).f(); // prints "void f()"
>     (cast(J)a).f(); // prints "int f()"


D also allows you to simply write:

a.I.f();
a.J.f();

also works for explicitly calling a base class implementation btw


More information about the Digitalmars-d mailing list