[fpc-devel] Generic method works on Linux, not on Windows?

Joost van der Sluis joost at cnoc.nl
Tue May 26 21:41:58 CEST 2020

Hi all,

I have something strange.

I have a generic function defined as follows:

generic function TJSONRttiStreamClass.CreateObjectFromJSONString<T 
(AJSONString: TJSONStringType; ADescriptionTag: string = ''): T;
   Result := nil;

When I call it, like this:

LaunchRequest := FSerializer.specialize 

Then I get a compiler-error on Windows, while it works on Linux:

csjsonrttistreamhelper.pas(81,1) Error: Wrong number of parameters 
specified for call to "$fin$00000037"

When I make the function empty (Remove Result := nil) it compiles.

Any idea what to look for?



More information about the fpc-devel mailing list