Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2022-02

bug or feature - more

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb

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.

Reply by email