Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi    [ Add a report in this area ]  
Report #:  105447   Status: Open
Invalid class destructor implementation compiles fine
Project:  Delphi Build #:  16.0.4429.46931
Version:    16.4 Submitted By:   Nicholas Ring
Report Type:  Basic functionality failure Date Reported:  5/8/2012 3:41:18 AM
Severity:    Infrequently encountered problem Last Updated: 5/16/2012 11:59:14 PM
Platform:    All platforms Internal Tracking #:   28255
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 the implementation of the class destructor is accidently set to:

    class constructor TTestObject.Destroy;

The compiler compiles without an issue.
Steps to Reproduce:
{code}
program Project1;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

type
  TTestObject = class(TObject)
  public
    class constructor Create;
    class destructor Destroy;
  end;

{ TTestObject }

class constructor TTestObject.Create;
begin

end;

//  NOTE: It should be 'destructor'
class constructor TTestObject.Destroy;
begin

end;

begin
  try
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.
{code}
Workarounds
None
Attachment
None
Comments

Tomohiro Takahashi at 5/17/2012 7:25:56 PM -
This report was opened with valid Internal Tracking Number.
Thanks.

Server Response from: ETNACODE01