Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2003-11

function overloading resolution order question

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

David Butler

Hi

How does FreePascal resolve ambigious calls to overloaded functions?

For example, if we have two procedures:

procedure Test(const X: Integer); overload;
procedure Test(const X: Extended); overload;

If a call is made to Test(1), the procedure with the Integer parameter is called.

When we have:

procedure Test(const X: Word); overload;
procedure Test(const X: Extended); overload;

and a call is made to Test(1), the procedure with the Extended parameter is called.

Regards
David

Reply by email