Delphi Error – E2535 Interface methods must not have parameterized methods

Delphi Compiler Error

E2535 Interface methods must not have parameterized methods

Reason for the Error & Solution

This occurs when trying to declare a parametrized method as part of an interface.

program E2535;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
IMyInterface = interface
  procedure Receive<T>(Event: T);
end;

begin
  Writeln('E2535 Interface methods must not have parameterized methods');
end.