[fpc-pascal] Can't determine which overloaded function to call
LacaK
lacak at zoznam.sk
Wed Dec 5 07:51:10 CET 2018
>
>> Hi *,
>>
>> this code compiles for target Win32 but does not compile for
>> Win64/x86-64. Why? Is there workaround?
>> (Error: Can't determine which overloaded function to call)
>> Thank you
> For me, in win32 works fine
Yes in Win32 works also for me. And this is my question why it does work
in Win32 and does not work in Win64?
>
> try this
>
> r1.Offset(a-Integer(1),b-Integer(1));
does not helps
>
> or
>
> r1.Offset(Integer(a-1),Integer(b-1));
helps, but why is it not needed in Win32? Why for Win32
"integer"-"integer" is considered as "integer" so compiler can determine
which overloaded function to call and for Win64 compiler compiler can
NOT determine which overloaded function to call?
It seems to me as inconsistent?
L.
=== code sample ===
TRec1 = record
x,y: integer;
function Offset(const Ax,Ay: integer): TRec1; overload;
function Offset(const Ax,Ay: single): TRec1; overload;
end;
function TRec1.Offset(const Ax,Ay: integer): TRec1;
begin
end;
function TRec1.Offset(const Ax,Ay: single): TRec1;
begin
end;
var
r1: TRec1;
a,b: integer;
begin
r1 := r1.Offset(a-1,b-1); // HERE Error:
end.
============================
More information about the fpc-pascal
mailing list