[fpc-pascal] Overloading doubt: bug or feature

leledumbo leledumbo_cool at yahoo.co.id
Wed May 15 10:59:10 CEST 2013


Is the following a bug or undocumented "feature"?

function f(s: string): string;
begin
  f := '''' + s + '''';
end;

function f(s: string): integer;
begin
  Val(s,f);
end;

var
  i: Integer;
begin
  // i := f('123'); // Error: Incompatible types: got "ShortString" expected
"SmallInt"
  WriteLn(f('123')); // Calls function f(s: string): string;
end.




--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Overloading-doubt-bug-or-feature-tp5714798.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list