[Lazarus] question with IDE

Ondrej Pokorny lazarus at kluug.net
Fri Jan 15 17:15:36 CET 2021


On 15.01.2021 13:34, Mattias Gaertner via lazarus wrote:
> Do you have a complete example unit (you can strip the statements and 
> vars)? 

See the attachment for two example units - obviously I cannot guarantee 
it is the same scenario that duilio experiences but it is definitely an 
example of Ctrl+Shift+C generating a duplicate method.

In general: if you delete a method A and add a method B to the interface 
whereas A and B are of different types ("class constructor" vs 
"constructor" vs "procedure/function") you get a duplicate.

I have known about this bug for a long time but have been too lazy to 
fix it :(


> Do you use IFDEFs?

No.

Ondrej

-------------- next part --------------
unit Unit1;

{$mode objfpc}

interface

type
  TMyClass = class
  public
    procedure DoClick(Sender: TObject);
  end;

implementation

{ TMyClass }

constructor TMyClass.Create;
begin
  inherited Create;

  Writeln('Create');
end;

end.

-------------- next part --------------
unit Unit2;

{$mode objfpc}

interface

type
  TMyClass = class
  public
    class constructor Create;
  end;

implementation

{ TMyClass }

constructor TMyClass.Create;
begin
  inherited Create;

  Writeln('Create');
end;

end.



More information about the lazarus mailing list