Hi,

I have a problem with overloaded functions. I defined these functions:
function val_(name: string): string;
function val_(name: string): boolean;
function val_(name: string): integer;
function val_(name: string): double;

var
  res: boolean;
begin
  res := val_(option_variable);
end;

I get the following error: Error: Incompatible types: got "ShortString"
expected "Boolean". So for some reason the compiler is looking at the
first function. The mode is objfpc and I turned ansistrings off. I
tested by adding the overload modifier but without result. What else
could I try or do? Or is overloading only allowed for different
parameter lists?

Rgds, Darius
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to