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/Declare Field
[ Add a report in this area ]
Report #:
58322
Status:
Closed
Declare Field does not work if you have multiple classes/interfaces in a unit
Project:
Delphi
Build #:
11.0.2902.10471
Version:
11.2
Submitted By:
Brian Kohrs
Report Type:
Basic functionality failure
Date Reported:
2/15/2008 12:07:04 PM
Severity:
Serious / Highly visible problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
258005
Resolution:
Fixed
(Resolution Comments)
Resolved in Build:
:
11.0.2902.10471
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
5.00 out of 5
Total Votes:
13
Description
If you have multiple class/interfaces in a unit and try to declare a field in a class that is not the first one, Declare Field puts the field in the declaration of the first class/interface.
Steps to Reproduce:
1. Open the attached project.
2. In TFoo.Foo, use the Declare Field refactoring on the FField identifier.
Expected result:
unit Unit1;
interface
type
IFoo = interface
['{D6528310-DB21-4ED4-8753-FC91E26D6271}']
end;
TFoo = class(TInterfacedObject, IFoo)
strict private
FField: Integer;
public
procedure Foo;
end;
implementation
{ TFoo }
procedure TFoo.Foo;
begin
FField := 1;
end;
end.
Actual result:
unit Unit1;
interface
type
IFoo = interface
['{D6528310-DB21-4ED4-8753-FC91E26D6271}']
FField: Integer;end;
TFoo = class(TInterfacedObject, IFoo)
public
procedure Foo;
end;
implementation
{ TFoo }
procedure TFoo.Foo;
begin
FField := 1;
end;
end.
Workarounds
Declare the field manually.
Attachment
Project1.zip
Comments
None
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