Should the below then work? (It currently does)

Note, using "TBar = class end;" inside TFoo => does not work (expected). It creates a type TFoo.TBar.

But the "type Abc = TBar"  >imports< the outer forward declaration.
Btw, the compiler also does not care which of the 2 procedure declarations is used.


program Project1;

type
  TBar = class;

  Tfoo =  class
    type Abc = TBar;

    Abc = class
      procedure Sub;
    end;
  end;

{ Tfoo.Abc }

//procedure TBar.Sub;
procedure Tfoo.Abc.Sub;
begin
end;

begin
  TBar.Create.Sub;
end.


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

Reply via email to