介面的繼承
介面可以相互繼承,就像類一樣。因此,實現類必須實現介面和所有基介面的功能。但是,這樣,編譯器不知道實現類也實現了基介面,它只知道明確列出的介面。這就是為什麼在 TImplementer 上使用 as ISuperInterface 是行不通的原因。這也導致了通常的做法,即明確實現所有基介面(在本例中為 TImplementer = class(TInterfacedObject, IDescendantInterface, ISuperInterface))。
ISuperInterface = interface
    ['{A2437023-7606-4551-8D5A-1709212254AF}']
    procedure Method1();
    function Method2(): Boolean;
end;
IDescendantInterface = interface(ISuperInterface)
    ['{6C47FF48-3943-4B53-8D5D-537F4A0DEC0D}']
    procedure SetValue(const aValue: TObject);
    function  GetValue(): TObject;
    property Value: TObject read GetValue write SetValue;
end;
TImplementer = class(TInterfacedObject, IDescendantInterface)
    // ISuperInterface
    procedure Method1();
    function Method2(): Boolean;
    // IDescendantInterface
    procedure SetValue(const aValue: TObject);
    function  GetValue(): TObject
    property Value: TObject read GetValue write SetValue;
end;