Why is this an issue?

Functions may omit the return type in their implementation if the return type has been defined in their declaration. This is confusing and unintuitive. For the sake of code readability, function return types should always be specified.

How to fix it

Ensure that the function's implementation signature matches its declaration:

interface

type TFoo = class(TObject)
  function Bar(Baz: Byte): Integer;
end;

implementation

function TFoo.Bar(Baz: Byte);
begin
  // ...
end;
interface

type TFoo = class(TObject)
  function Bar(Baz: Byte): Integer;
end;

implementation

function TFoo.Bar(Baz: Byte): Integer;
begin
  // ...
end;