Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Refactoring/Change Parameters    [ Add a report in this area ]  
Report #:  47961   Status: Reported
refactoring array property method produces invalid code
Project:  Delphi Build #:  10.0.2288.42451
Version:    10.0 Submitted By:   Ondrej Popelka
Report Type:  Basic functionality failure Date Reported:  6/22/2007 3:13:19 PM
Severity:    Commonly encountered problem Last Updated: 1/4/2008 4:43:36 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Given this unit:

unit Unit2;
interface
type
another = class
  private
    function Getprop(i: integer): tobject;
    procedure Setprop(i: integer; const Value: tobject);
  published
    property prop[i: integer]: tobject read Getprop write Setprop;
end;

implementation

function another.Getprop(i: integer): tobject;
begin
end;

procedure another.Setprop(i: integer; const Value: tobject);
begin
end;
end.


And refactoring SetProp() from i: integer to const i: integer
Produces invalid code:
property prop[i: integer]: tobject read Getprop write Setprop(, );
Steps to Reproduce:
refactor - change of SetProp method
1. delete existing param i: integer
2. add new param const i: integer
property declaration is now invalid
property prop[i: integer]: tobject read Getprop write Setprop(, )
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01