[fpc-pascal] Traits Proposal

Ryan Joseph genericptr at gmail.com
Mon Feb 15 18:08:25 CET 2021



> On Feb 15, 2021, at 9:08 AM, Marcos Douglas B. Santos via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> As I understand, this is not a method hiding, but just to tell the
> compiler which method to implement the interface—the interface could
> have method names which are very very common to use and this syntax
> allows us to "rename" those methods without changing the original
> names that the class might have.

yeah you may be right, that the interface object itself won't be hookup correctly if this doesn't happen. Seems strange you have 2 declarations for the same method though.

  procedure IMyIntf.Test2 = MyTest2;
  propcedure MyTest2;


instead of something like:
  
  propcedure MyTest2 override  IMyIntf.Test2;


Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list