Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Generics    [ Add a report in this area ]  
Report #:  120262   Status: Closed
F2084 Internal Error with Generics method pointer
Project:  Delphi Build #:  19.0.13856.4978
Version:    19.0 Submitted By:   Francois Piette (OverByte)
Report Type:  Crash / Data loss / Total failure Date Reported:  11/5/2013 11:21:09 AM
Severity:    Commonly encountered problem Last Updated: 4/15/2014 6:37:10 PM
Platform:    All platforms Internal Tracking #:   44873
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 10
Description
Try to compile the code in "Step" and you get "F2084 Internal Error: AV0A8CFA0F-R00000001-0"
The culprit line is marked.
Steps to Reproduce:
Steps by USc (OP code attached as GenericNumbersSample.dpr)
- dcc QC120262.dpr

expected: it compiles
actual: QC120262.dpr(33) Fatal: F2084 Internal Error: AV004C81AB-R00000001-0

- dcc32 GenericNumbersSample.dpr

expected: it compiles
actual: GenericNumbersSample.dpr(61) Fatal: F2084 Internal Error: AV004C81AB-R00000001-0

//--- QC120262.dpr ---
program QC120262;

{$APPTYPE CONSOLE}

type
  Number<T> = class
  public
    class procedure Add; virtual; abstract;
  end;

  FloatNumber = class(Number<Single>)
  public
    class procedure Add; override;
  end;

  Adder<T> = procedure of object;

class procedure FloatNumber.Add;
begin
end;

type
  Algorithms = record
  public
    class procedure Sum<T; NumberImpl: Number<T>>; static;
  end;

class procedure Algorithms.Sum<T, NumberImpl>;
var
  F: Adder<T>;
begin
  F := NumberImpl.Add;
end;

procedure Test;
begin
  Algorithms.Sum<Single, FloatNumber>;
end;

begin
  WriteLn('PASS'); // on compile
end.
Workarounds
None
Attachment
JEDD9E9.zip
Comments

Tomohiro Takahashi at 11/6/2013 5:34:25 PM -
> Try to compile the code in "Step" ...
Codes in [Steps] are truncated...
Could you please attach sample project to reproduce/confirm your issue?

Francois Piette (OverByte) at 11/9/2013 11:01:29 PM -
Here is the missing part:

  WriteLn(Format('%10.15f', [ref]));
  WriteLn(Format('%10.15f', [ref-sum]));
  ReadLn;
end;

begin
  try
    Test;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.


btw: The QC attachement feature crashes.

Server Response from: ETNACODE01