On Nov 25, 2025 at 4:48:52 PM, Michael Van Canneyt via fpc-devel <
[email protected]> wrote:

> Delphi allows to overload a generic with a non-generic class.
>
> TFoo = class end;
> TFoo <a> = class F: a end;
>
> FPC has experimental support for this as far as I know.
>
> So the answer would be:
> Yes, the specialize will look for a generic definition, ignoring classes
> with the same name that are not generic.
>

specialize TFoo<byte> actually searches for the symbol "TFoo$1" so it's a
different symbol name than just TFoo.

I think though if tried to declare TFoo like "a: TFoo"  it would give an
error that generics can't be used without specialization thus make using
TFoo unusable, but I may be wrong about that.
_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to