Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
IDE
Add Component Template
Background compile
Batch file target
Block Completion
Build Tools
Caliber
Class Completion
Class Explorer
Code Browsing
Code Completion
Code Editor
Code Explorer
Code Parameters
Code Templates
Compiler Message Window
Deployment Manager
Dialogs
Direct
Docking
File Browser
File Handling
Form Designer
Help
History View
IDE Insight
Memory Issues
Menu Designer
Menus
Module Manager
Multi-Monitor Support
Object Inspector
Object TreeView
Open Tools API
Packages
Performance
Printing
Project Explorer(old Object Browser)
Project Management
Refactoring
Repository
Save Desktop
Search
Start Page
Starteam
Startup/Shutdown
Structure Pane
System Resources
ToDoList
Tool Palette
Toolbars/Status Line
Translation Tools
Unit Testing
Version Control
VersionInfo
Views
Visual Form Inheritance
Workgroup(PVCS)
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/IDE/Class Completion
[ Add a report in this area ]
Report #:
91771
Status:
Open
Class completion on descendant overriden abstract method: Useless Inherited
Project:
Delphi
Build #:
14.0.3593.25826
Version:
15.1
Submitted By:
David Tetard
Report Type:
Minor failure / Design problem
Date Reported:
2/24/2011 12:37:10 PM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
282031
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
If you have the following code (Important: the two classes must be in different units):
Unit One;
TMyAncestor = Class(TObject)
Public
Procedure Foo; Virtual; Abstract;
End;
Unit Two;
Interface
Uses One;
TMyDescendant = Class(TMyAncestor)
Public
Procedure Foo; Override;
End;
If you do a Ctrl + C on TMyDescendant's Foo, the following is created:
TMyDescendant.Foo;
Begin
Inherited;
End;
The "Inherited" appears to be completely useless as there is no point calling an abstract method. This works fine when both classes are in the same unit.
Steps to Reproduce:
See description.
Workarounds
None
Attachment
None
Comments
Tomohiro Takahashi at 2/24/2011 7:04:46 PM
-
> Build No: 14.0.3593.25826
I can not reproduce your issue with Delphi 2010(Build No: 14.0.3615.26342).
So, have you already applied all of Updates/Hotfixes?
David Tetard at 2/25/2011 10:28:37 PM
-
Yes, you are right and I found why:
If TMyAncestor are in the same unit, the Inherited is not added as expected.
If the two objects are in different units, Inherited is added as shown below:
unit Unit4;
interface
Type
TAncestor = Class(TObject)
Public
Procedure Foo; Virtual; Abstract;
End;
implementation
end.
============================
unit Unit3;
interface
Uses Unit4;
Type
TMyObject = Class(TAncestor)
Public
Procedure Foo; Override;
End;
implementation
{ TMyObject }
procedure TMyObject.Foo;
begin
inherited;
end;
end.
Tomohiro Takahashi at 2/26/2011 4:41:43 AM
-
Ok, so please correct [Description] field by using Windows Native QC Client to open/track this issue properly? The standalone client comes with Delphi.
Thanks.
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