HomeDelphiDelphi Error – E2259 Implements clause only allowed for properties of class or interface type

Delphi Error – E2259 Implements clause only allowed for properties of class or interface type

Delphi Compiler Error

E2259 Implements clause only allowed for properties of class or interface type

Reason for the Error & Solution

An attempt has been made to use the implements clause with an improper type. Only class or interface types may be used.

program Produce;
type
  TMyClass = class(TInterfacedObject)
    FInteger : Integer;
    property MyInterface: Integer read FInteger implements Integer;
  end;
end.


In this example the error is caused because an Integer type is used with an implements clause.

The only solution for this error is to correct the implements clause so that it refers to a class or interface type, or to remove the offending clause altogether.

Share:

Leave A Reply

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

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...