Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Code Completion    [ Add a report in this area ]  
Report #:  47274   Status: Closed
Overload methods does not appear in Code Complete list
Project:  Delphi Build #:  11.0.2709.7128
Version:    11.2 Submitted By:   Shen Chye Tan
Report Type:  Basic functionality failure Date Reported:  6/9/2007 4:21:45 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   256073
Resolution: As Designed (Resolution Comments) Resolved in Build: : 14.0.3494.23546
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: 11
Description
For cases where there are overloaded methods, the Code Complete list does not seem to list these.  However, it does list one of the methods where the return type is boolean, integer, etc, but apparently not string types.

This problem was not there in BDS2005, where it lists all the overloaded methods.

I have attached a simple test set of codes in the "Steps to Reproduce".

Thank you.
Steps to Reproduce:
<SAMPLE CODE BEGIN>

unit code_complete_Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  testclass = class (TObject)
  public
    function returnstring (s: string): string; overload;
    function returnstring (s: widestring): widestring; overload;
    function returnbool (s: integer): bool; overload;
    function returnbool (s: extended): bool; overload;
    function returnnumber (s: string): integer; overload;
    function returnnumber (s: widestring): extended; overload;
    function returnsimple (s: widestring): boolean;
  end;


  TForm3 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation
{$R *.dfm}
function testclass.returnsimple (s: widestring): boolean;
begin result := true; end;
function testclass.returnstring (s: string): string;
begin result := ''; end;
function testclass.returnstring (s: widestring): widestring;
begin result := ''; end;
function testclass.returnbool (s: integer): bool;
begin result := true; end;
function testclass.returnbool (s: extended): bool;
begin result := true; end;
function testclass.returnnumber (s: string): integer;
begin result := 1; end;
function testclass.returnnumber (s: widestring): extended;
begin result := 1; end;



procedure TForm3.Button1Click(Sender: TObject);
var
  t: testclass;
begin

  t
:= testclass.Create;
  // if you type "t." below, the Code Complete list shows
  // only returnbool and returnsimple method appears
  // returnnumber and returnstring is missing
  
  t.Free;


end;

end.

<SAMPLE CODE END>
Workarounds
None.
Attachment
None
Comments

Sebastian Zierer at 10/26/2007 1:26:35 AM -
I think this is not just a documentation problem. I'd see that more as a basic functionality failure, because it could be the reason that a programmer completely doesn't know that a particular function exists in a class.

Same problem for:

    procedure Test(X, Y: Integer; const Text: WideString); overload;
    procedure Test(X, Y: Integer; const Text: String); overload;

Server Response from: ETNACODE01