HomeDelphiDelphi Error – E2208 Interface ‘%s’ already implemented by ‘%s’

Delphi Error – E2208 Interface ‘%s’ already implemented by ‘%s’

Delphi Compiler Error

E2208 Interface ‘%s’ already implemented by ‘%s’

Reason for the Error & Solution

The class specified by name2 has specified the interface name1 more than once in the inheritance section of the class definition.

program Produce;
  type
    IBaseIntf = interface
    end;

    TBaseClass = class (TInterfacedObject, IBaseIntf, IBaseIntf)
    end;

begin
end.

In this example, the IBaseIntf interface is specified multiple times in the inheritance section of the definition of TBaseClass. As a class can not implement the same interface more than once, this cause the compiler to emit the error message.

program Solve;

  type
    IBaseIntf = interface
    end;

    TBaseClass = class (TInterfacedObject, IBaseIntf)
    end;

begin
end.

The only solution to this error message is to ensure that a particular interface appears no more than once in the inheritance section of a class definition.

Share:

Leave a Reply

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...