Delphi Error – E2207 ‘%s’ clause not allowed in interface type

Delphi Compiler Error

E2207 ‘%s’ clause not allowed in interface type

Reason for the Error & Solution

The clause noted in the message is not allowed in an interface type. Typically this error indicates that an illegal directive has been specified for a property field in the interface.

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

The problem in the above program is that the stored directive is not allowed in interface types.

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

begin
end.

The solution to problems of this nature are to remove the offending directive. Of course, it is best to understand the desired behavior and to implement it in some other fashion.

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