View Issue Details

IDProjectCategoryView StatusLast Update
0026484FPCCompilerpublic2020-04-05 01:58
ReporterMaciej Izak Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2.7.1 
Summary0026484: Generics Internal error 2014052305
DescriptionGenerics Internal error 2014052305 for this code:

unit Generics.Collections;

{$MODE DELPHI}
{$MACRO ON}
{$DEFINE CUSTOM_DICTIONARY_CONSTRAINTS := TKey, TValue}

interface

uses
  Classes, SysUtils;

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

  TEnumerator<T> = class abstract
  protected
    function DoGetCurrent: T; virtual; abstract;
  end;

  TCustomDictionaryEnumerator<T, CUSTOM_DICTIONARY_CONSTRAINTS> = class abstract(TEnumerator< T >)
  protected
    function DoGetCurrent: T; override;
    function GetCurrent: T; virtual; abstract;
  end;

implementation

function TCustomDictionaryEnumerator<T, CUSTOM_DICTIONARY_CONSTRAINTS>.DoGetCurrent: TPair<TKey, TValue>; // compiler should raise error for this line
begin
  Result := GetCurrent;
end;

end.
Tagsgenerics
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0027206 resolvedSven Barth [Patch] Christmas gift by FreeSparta : Generics.Collections 

Activities

Maciej Izak

2014-07-13 22:58

reporter  

005.zip (734 bytes)

Bi0T1N

2020-04-05 01:58

reporter   ~0121911

Compiles without errors in 3.2.0rc1 and 3.3.1-r44326

Issue History

Date Modified Username Field Change
2014-07-13 22:58 Maciej Izak New Issue
2014-07-14 06:15 Maciej Izak File Added: 005.zip
2014-07-18 16:10 Sven Barth Tag Attached: generics
2015-01-06 14:30 Sven Barth Relationship added related to 0027206
2020-04-05 01:58 Bi0T1N Note Added: 0121911