<html><body><div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Nov 25, 2025 at 4:48:52 PM, Michael Van Canneyt via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>> wrote:<br></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" type="cite">
<div>Delphi allows to overload a generic with a non-generic class.<br><br>TFoo = class end;<br>TFoo <a> = class F: a end;<br><br>FPC has experimental support for this as far as I know.<br><br>So the answer would be: <br>Yes, the specialize will look for a generic definition, ignoring classes<br>with the same name that are not generic.<br></div>
</blockquote>
</div>
<br>
<div dir="ltr">specialize TFoo<byte> actually searches for the symbol "TFoo$1" so it's a different symbol name than just TFoo.<br></div><div dir="ltr"><br></div><div dir="ltr">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.</div></body></html>