[fpc-devel] Generic method works on Linux, not on Windows?
Joost van der Sluis
joost at cnoc.nl
Wed May 27 00:01:24 CEST 2020
Op 26-05-2020 om 23:36 schreef Yuriy Sydorov:
> Does it happen with the fpc trunk?
> If yes, what revision do you use? It looks like an issue with my initial
> implementation of the $parentfp parameter optimization. "$fin$00000037"
> is a reference to an internal SEH handler procedure which is a special
> nested procedure.
Yes, Trunk, updated last sunday. (And today, didn't help) x86_64
> The latest trunk for win32 compiles fine the following modified example:
>
> {$mode objfpc}{$H+}
>
> generic function CreateObjectFromJSONString<T>(AJSONString: string;
> ADescriptionTag: string = ''): T;
> begin
> Result := nil;
> end;
>
> var
> LaunchRequest: TObject;
> begin
> LaunchRequest := specialize CreateObjectFromJSONString<TObject>('qwe');
> end.
It's this project: https://gitlab.freepascal.org/Joost/fpdserver/
And the generic function is defined in:
https://gitlab.freepascal.org/Joost/cerialization
I'll try your code tomorrow. Maybe I can get an easier example.
Regards,
Joost.
More information about the fpc-devel
mailing list