Wrong function calling (on ambiguous functions)
Original Reporter info from Mantis: Filuta Vitaliy
-
Reporter name: FVI
Original Reporter info from Mantis: Filuta Vitaliy
- Reporter name: FVI
Description:
Program calls function IntToHEX from my_unit, but inplace of that called IntToHEX from SysUtils
Result:
10
passed
must be:
passed
passed
Additional information:
-------------------------------------------------------------------------------
program project1;
{$mode objfpc}{$H+}
uses SysUtils, my_unit;
var
A, B: PtrInt;
begin
writeln(my_unit.IntToHEX(16, 0)); {Here ERROR: called SysUtils.IntToHEX }
A := 16;
B := 0;
writeln(my_unit.IntToHEX(A, B));
end.
-------------------------------------------------------------------------------
unit my_unit;
{$mode objfpc}{$H+}
interface
function IntToHEX(Value, Digits: PtrInt): string; overload;
implementation
function IntToHEX(Value, Digits: PtrInt): string;
begin
IntToHEX := 'passed';
end;
end.
Mantis conversion info:
- Mantis ID: 17220
- OS: WindowsXP
- OS Build: any
- Build: ?
- Platform: x86_64
- Version: 2.4.0
- Fixed in version: 2.6.0
- Fixed in revision: 15887 (#5ca1bd2a)