Call by function var ignores overloading
<h3><details><summary>Original Reporter info from Mantis: <small>Nitorami</small></summary><small>
- **Reporter name:**
</small></details></h3>
## Description:
In fpc mode, when calling a function by address, the compiler stops when encountering the first function declaration that does not match, ignoring overloaded versions.
In delphi mode, it works as expected, hence I think it is a bug.
## Steps to reproduce:
``` pascal
{$MODE fpc}
type TMyFunc = function (x: single): single;
function Foo (x: array of single): single; overload;
begin
Foo := 2*x[0];
end;
function Foo (x: single): single; overload;
begin
Foo := 2*x;
end;
procedure GoAhead (x: single; func: TMyFunc);
begin
writeln (func (x));
end;
begin
GoAhead (42, @Foo);
//compiler stops on the first definition of foo
//which does not match TMyFunc
end.
```
## Mantis conversion info:
- **Mantis ID:** 23997
- **OS:** XP
- **OS Build:** SP3
- **Platform:** Win32
- **Version:** 2.6.2
- **Monitored by:** » AntonK (Anton Kavalenka)
issue