This can't be right, can it?

type
   TBird = class
     procedure Fly;
   end;
   TEagle = TBird; // alias

procedure TEagle.Fly;
begin
end;


It does depend on what you expect an Type-Alias to be.

If you expect the compiler to generate an compatible class then your example must not be compilable.

If you expect an alias die make the Typenames "TEagle" and "TBird" equivalent it is no problem for the compiler which name you use at what place.

In any case I would judge such code as "bad style" - programmers should avoid doing so.


Elmar


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

Reply via email to