Code completion duplicates method implementation

Original Reporter info from Mantis: Ask
  • Reporter name: Alexander S. Klenin

Description:

If the header of the method implementation is different from,
but equivalent to, the interface, code completion sometimes becomes confused.

Steps to reproduce:

  1. Enter code:
---
type
  TTest = class
    procedure P1(A: Integer = 0; B: Integer = -1);
  end;

procedure TTest.P1(A, B: Integer);
begin end;
---
  1. Activate code completion
    =>
    the header of procedure P1 implementation is changed to
    procedure TTest.P1(A: Integer; B: Integer);

This is not quite a bug, but still suboptimal.

However,
1a) Enter code:
---
type
  TTest = class
    procedure P1(A: Integer = 0; B: Integer = -1);
    procedure P2;
  end;

procedure TTest.P1(A, B: Integer);
begin end;
---
1b) Activate code completion
=>
Code completion adds

procedure TTest.P1(A: Integer; B: Integer);

not touching the existing implementation.

Mantis conversion info:

  • Mantis ID: 18793