I have a problem with the delegation of the inherited interface.

I have a problem with the delegation of the inherited interface.

  IMyInterface = interface
    procedure P1;
    procedure P2;
  end;

  IOtherInterface = interface(IMyInterface)
   procedure OtherMethod;
  end;

  TMyClass = class(TInterfacedObject, IOtherInterface, IMyInterface) <-- compile error
  private
    fMyInterface: IMyInterface;
    function GetMyInterface: IMyInterface;
    procedure OtherMethod;
  public
    property MyInterface: IMyInterface read GetMyInterface implements IMyInterface;
  end;


[dcc32 Error] unit.pas(21): E2291 Missing implementation of interface method IMyInterface.P1
[dcc32 Error] unit.pas(21): E2291 Missing implementation of interface method IMyInterface.P2


Is it possible to somehow get around this problem? I do not want to implement a second time IMyInterface methods.

Comments