Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Generics    [ Add a report in this area ]  
Report #:  75543   Status: Closed
F2084 Internal Error: C12079 when using TDictionary's TPair enumerator
Project:  Delphi Build #:  12.0.3420.21218
Version:    12.1 Submitted By:   Uwe Schuster
Report Type:  Crash / Data loss / Total failure Date Reported:  7/5/2009 4:31:00 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   270742
Resolution: Fixed (Resolution Comments) Resolved in Build: : 14.0.3475.22729
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
This was reported by simon horup in embarcadero.public.delphi.language.delphi.win32 in the thread "Internal Error T2402 when enumerating a tDictonary under Delphi 2009Update 3 / 4"
Message-ID: <134128@forums.codegear.com>
https://forums.codegear.com/thread.jspa?messageID=132786&tstart=0#132786

-> see steps
Steps to Reproduce:
- save the following three files or the attachment
- dcc32 PairEnumeratorTest.dpr

expected: it compiles
actual: PairEnumeratorTest.dpr(12) Fatal: F2084 Internal Error: C12079

//--- PairEnumeratorTest.dpr ---
program PairEnumeratorTest;

{$APPTYPE CONSOLE}

uses
  Unit2, Generics.Collections;

var
  Pair: TPair<Integer, string>;
begin
  for Pair in Testing do;
end.
//--- unit2.pas ---
unit Unit2;

interface

uses
  Generics.Collections;

var
  Testing: TDictionary<Integer, string>;

implementation

end.
//--- Generics.Collections.pas ---
unit Generics.Collections;

interface

type
  TEnumerator<T> = class abstract
  protected
    function DoGetCurrent: T; virtual; abstract;
  public
    property Current: T read DoGetCurrent;
    function MoveNext: Boolean;
  end;

  TEnumerable<T> = class abstract
  public
    function GetEnumerator: TEnumerator<T>;
  end;

  TPair<TKey,TValue> = record
    Key: TKey;
    Value: TValue;
  end;

  TDictionary<TKey,TValue> = class(TEnumerable<TPair<TKey,TValue>>)
  end;

implementation

function TEnumerator<T>.MoveNext: Boolean;
begin
  Result := False;
end;

function TEnumerable<T>.GetEnumerator: TEnumerator<T>;
begin
  Result := nil;
end;

end.
Workarounds
None
Attachment
JED88D2.zip
Comments

Tomohiro Takahashi at 7/6/2009 12:42:13 AM -
Is 'Generics.Collections.pas', which is atached, necessary for this case?

Uwe Schuster at 7/6/2009 1:39:57 AM -
Yes and No.

Yes because it is minimized to make it easier for R&D to find the error and No, because it repeats with the delivered Generics.Collections.pas too.

Server Response from: ETNACODE01