[fpc-devel] Overloading problem in generic class.

Maxim Ganetsky ganmax at narod.ru
Sun Sep 18 13:10:08 CEST 2022


18.09.2022 12:37, Bart via fpc-devel пишет:
> Hi,
> 
> The following program will compile for Windows 32 and 64 bit.
> It fails to compile for Linix 64 bit (and if I understand correctly,
> also for MacOS 64 bit).

<...>

> Linux 64-bit
> Compile Project, Target: test: Exit code 1, Errors: 1, Hints: 3
> test.lpr(40,13) Error: Can't determine which overloaded function to call
> test.lpr(22,10) Hint: Found declaration: SameValue(const Single;const
> Single):Boolean;
> test.lpr(15,10) Hint: Found declaration: SameValue(const Double;const
> Double):Boolean;
> test.lpr(7,10) Hint: Found declaration: SameValue(const Extended;const
> Extended):Boolean;
> 
> If I remove the typecast then it compiles OK on all platforms.
> 
> (fpc 3.2.2 of fpc main seem to do the same)
> 
> I simply do not understand where the difference between
> Windows/Non-Windows comes from.

As far as I see from CI build log, FPC 3.2.0 is the culprit. FPC 3.2.2 
compiles your code fine both on Linux and Windows.

-- 
Best regards,
  Maxim Ganetsky                  mailto:ganmax at narod.ru


More information about the fpc-devel mailing list