In Delphi Seattle 10 I'm trying to delegate the implementation of an interface using the implements
keyword, but when an interface derived from the first one is also included in the class declaration, the delegation is not accepted.
Compilation of the code below fails with a "Missing implementation of interface method IInterface1.DoSomethingFor1" message. If I remove the IInterface2 from the class declaration, the code compiles. If I derive IInterface2 from something else then IInterface1 it also compiles.
What am I doing wrong? Or how can I accomplish this?
type
IInterface1 = interface(IInterface)
['{03FB3E2E-C0DD-4E17-B6CD-D333E1E7255E}']
procedure DoSomethingFor1;
end;
Iinterface2 = interface(IInterface1)
['{89C266E2-2816-46AD-96AA-DD74E78A4D1E}']
end;
T1 = class(TInterfacedObject, IInterface1, IInterface2)
private
Fi1: IInterface1;
public
property I1_Delegate: IInterface1 read Fi1 implements IInterface1;
end;