Implicit function specialization and for inherited fuctions
## Summary
Considering the new 90844c2027e078fcc1ff6b8d3df911a77bac2ed3, this code is not correctly compiled.
## System Information
Lazarus 2.3.0 (rev main-2_3-1668-g34b3b9a49a) FPC 3.3.1 x86_64-win64-win32/win64
## Example Project
```pascal
program Project1;
{$mode objfpc}{$H+}
{$ModeSwitch implicitfunctionspecialization}
uses
Generics.Collections;
generic procedure Foo<T>(lst: specialize TEnumerable<T>);
begin
end;
var
lst: specialize TList<Integer>; // Inherits from TEnumerable
begin
Foo(lst); // Error
specialize Foo<Integer>(lst); // works
end.
```
Related issue: #39677
issue