Delphi Error – E2206 Property overrides not allowed in interface type

Delphi Compiler Error

E2206 Property overrides not allowed in interface type

Reason for the Error & Solution

A property which was declared in a base interface has been overridden in an interface extension.

program Produce;
  type
    Base = interface
      function Reader : Integer;
      function Writer(a : Integer);
      property Value : Integer read Reader write Writer;
    end;

    Extension = interface (Base)
      function Reader2 : Integer;
      property Value Integer read Reader2;
    end;

begin
end.

The error in the example is that Extension attempts to override the Value property.

program Solve;
  type
    Base = interface
      function Reader : Integer;
      function Writer(a : Integer);
      property Value : Integer read Reader write Writer;
    end;

    Extension = interface (Base)
      function Reader2 : Integer;
      property Value2 Integer read Reader2;
    end;

begin
end.

A solution to this error is to rename the offending property. Another, more robust, approach is to determine the original intent and restructure the system design to solve the problem.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...