[fpc-pascal] Helper/function overloads

Ryan Joseph ryan at thealchemistguild.com
Wed Apr 10 16:04:37 CEST 2019


Is this a bug or intended behavior? I can call it like Test.DoThis but it seems like overloading should work.

{$mode objfpc}
program test;

type
  THelper = class helper for TObject
    procedure DoThis; overload;
  end;

procedure DoThis (param: string); overload;
begin
end;

procedure THelper.DoThis;
begin
  DoThis('string'); // <——— ERROR: Wrong number of parameters specified for call to "DoThis"
end;

begin
end.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list