Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
IDE
Refactoring
C++Rename
C++Undo Support
Change Parameters
Create Variable
Declare Field
Declare Variable
Extract Interface
Extract Method
Extract Resourcestring
Extract Superclass
Find Class
Find References
Find Unit
Inline Variable
Introduce Field
Introduce Variable
Move Members
Pull Member Up
Push Members Down
Rename
Safe Delete
Undo Support
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/IDE/Refactoring/Rename
[ Add a report in this area ]
Report #:
34297
Status:
Closed
Rename refactoring doesn't work with overloaded methods.
Project:
Delphi
Build #:
10.0.2288.42451
Version:
10.0
Submitted By:
Dimitry Timokhov
Report Type:
Minor failure / Design problem
Date Reported:
9/21/2006 9:33:33 PM
Severity:
Serious / Highly visible problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
242045
Resolution:
Fixed
(Resolution Comments)
Resolved in Build:
:
11.0.2573.3635
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
5.00 out of 5
Total Votes:
None
Description
See "Steps" tabsheet.
Steps to Reproduce:
1. Type this project
{$o-}
program Project1;
type
TMyClass = class
public function M(A: Integer): Integer; overload;
public function M(A: String): String; overload;
end;
function TMyClass.M(A: Integer): Integer;
begin
Result := A;
end;
function TMyClass.M(A: String): String;
begin
Result := A;
end;
var
C: TMyClass;
I: Integer;
S: String;
begin
C := TMyClass.Create();
I := C.M(1);
S := C.M('1');
end.
2. Try to complie. All OK - the code is correct.
3. Place cursor just before the first appearance of M like this (i marked cursor position with help of symbol "|")
TMyClass = class
public function |M(A: Integer): Integer; overload;
public function M(A: String): String; overload;
end;
4. Apply Rename refactoring. Rename M to M1
5. EXPECTED behaviour. Project changes to
{$o-}
program Project1;
type
TMyClass = class
public function M1(A: Integer): Integer; overload;
public function M(A: String): String; overload;
end;
function TMyClass.M1(A: Integer): Integer;
begin
Result := A;
end;
function TMyClass.M(A: String): String;
begin
Result := A;
end;
var
C: TMyClass;
I: Integer;
S: String;
begin
C := TMyClass.Create();
I := C.M1(1);
S := C.M('1');
end.
ACTUAL behaviour. Project changes to
{$o-}
program Project1;
type
TMyClass = class
public function M1(A: Integer): Integer; overload;
public function M(A: String): String; overload;
end;
function TMyClass.M1(A: Integer): Integer;
begin
Result := A;
end;
function TMyClass.M(A: String): String;
begin
Result := A;
end;
var
C: TMyClass;
I: Integer;
S: String;
begin
C := TMyClass.Create();
I := C.M1(1);
S := C.M1('1'); !!!!!! ERROR HERE
end.
=====================
If you apply refactoring to M(A: String): String you a also get unexpected results.
Workarounds
None
Attachment
None
Comments
Leo Siefert at 9/22/2006 4:47:11 AM
-
That's ugly!
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us