Re: [fpc-pascal] Overloading doubt: bug or feature

2013-05-15 Thread Jonas Maebe
On 15 May 2013, at 10:59, leledumbo wrote: 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 "Sho

[fpc-pascal] Overloading doubt: bug or feature

2013-05-15 Thread leledumbo
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('