RAD Studio Athens

E2262

Go Up to Error and Warning Messages (Delphi)

The compiler has encountered a getter or setter which does not have the correct calling convention.


program Produce;
type
  I0 = interface
  end;

  T0 = class(TInterfacedObject, I0)
    function getterย : I0; cdecl;
    property p0ย : I0 read getter implements I0;
  end;

function T0.getterย : I0;
begin
end;
end.


As you can see in this example, the cdecl on the function getter causes this error to be produced.


program Solve;
type
  I0 = interface
  end;

  T0 = class(TInterfacedObject, I0)
    function getterย : I0;
    property p0ย : I0 read getter implements I0;
  end;

function T0.getterย : I0;
begin
end;
end.


The only solution to this problem is to remove the offending calling convention from the property getter declaration.