Are there? Or is there something else?

The below compiles. No duplicate TBar. Looks like a forward declaration...

program Project1;{$Mode objfpc}
type
  generic TBar<A,B> = class; // forward

  generic TBar<A, B> = class
    F:A;
    X:B;
  end;

begin
end.



But the next does not compile "Identifier not found TBar" (inside TFoo). Yet the identifier is clearly there.

https://gitlab.com/freepascal.org/fpc/source/-/issues/24097 seems to say it is supported since 2022?

program Project1;
{$Mode objfpc}
type

  generic TBar<A,B> = class; // forward

  generic TFoo<A, B> = class
    F:specialize TBar<A>;
    X:B;
  end;

  generic TBar<A, B> = class
    F:specialize TFoo<A>;
    X:B;
  end;

begin

end.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to