Am 14.03.2021 um 19:10 schrieb Ryan Joseph via fpc-pascal:
This program compiles, but is it a bug? I would think the specialization should fail 
because "S" in TArray is not specified.

========================

{$mode objfpc}

type
   generic TArray<T, S> = array of T;
generic procedure DoThis<T>(param: specialize TArray<specialize TArray<T>>);
begin
end;

begin
   specialize DoThis<integer>([[1],[2],[3]]);
end.

The TArray<T> generic type is part of the ObjPas unit, so the compiler simply picks that instead of that of your program. ;)

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to