Does interface delegation of an inherited interface require a wrapper class?

后端 未结 2 1880
忘掉有多难
忘掉有多难 2021-01-19 06:12

Delphi allows for interface delegation using the implements keyword.

For example

IIndep1 = interface
  function foo2: integer;
end;

IIn         


        
2条回答
  •  逝去的感伤
    2021-01-19 07:04

    Is there a way to avoid the wrapper class ancestor?

    No, the inherited interface has to be bound to a an ancestor class. Delphi does not implicitly bind inherited interfaces, because of reasons explained here. Also, it cannot bind to the current class, unless it manually delegates all calls to the composed item.

    We are left with only one option. An ancestor wrapper class, to which we can bind ILev1

提交回复
热议问题