Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Code Editor/Code Formatter    [ Add a report in this area ]  
Report #:  91630   Status: Closed
Formatter dont like anonymous methods
Project:  Delphi Build #:  15.0.3953.35171
Version:    15.1 Submitted By:   Entwicklung Lime-Tec
Report Type:  Basic functionality failure Date Reported:  2/18/2011 6:14:00 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   281927
Resolution: Fixed (Resolution Comments) Resolved in Build: : 16.0.4148.39198
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
The Code Formatter don't like anonymous methods... The Code is messed up after formatting.
Steps to Reproduce:
//Format this Source:

program Project1;

type
  TAnonMethod = reference to procedure(aParam: Boolean);

procedure UseAnonMethod(AAnonMethod: TAnonMethod);
begin
  AAnonMethod(True);
end;

begin
  UseAnonMethod(
    procedure(aParam: Boolean) begin
      if not aParam then
        Halt;
    end);
end.

//
//Formatter will formate the source above like this:
//

program Project1;

type
  TAnonMethod = reference to procedure(aParam: Boolean);

procedure UseAnonMethod(AAnonMethod: TAnonMethod);
begin
  AAnonMethod(True);
end;

begin
  UseAnonMethod( procedure(aParam: Boolean)begin if not aParam then Halt; end);
end.
Workarounds
None
Attachment
None
Comments

Tomohiro Takahashi at 2/19/2011 5:40:30 AM -
Is your issue similar to QC#89198 ?

Server Response from: ETNACODE01