[Lazarus] IDE docking flaw?

Sven Barth pascaldragon at googlemail.com
Tue Jun 7 21:44:09 CEST 2011


Am 07.06.2011 15:30, schrieb Hans-Peter Diettrich:
>> There are LCL applications. ShowControl existed since revision 5536 in
>> the LCL. You can find out such facts with svn blame.
>
> How are these affected by an added default parameter?

type
   TWinControl = class
   protected
     // this is the procedure that's extended by you with a default param
     procedure ShowControl(aControl: TControl; aSomeOtherParam: 
TSomeType = stValue); virtual;
   end;

   // this is some 3rd party control that isn't modified, but overrides 
ShowControl
   TSomeOtherControl = class(TWinControl)
   protected
     procedure ShowControl(aControl: TControl); override;
   end;

Compilation will generate the following error: There is no method in 
ancestor class to be overridden.

That's quite an affection, don't you think? ;)

Regards,
Sven




More information about the Lazarus mailing list