Generic forward type declaration
Original Reporter info from Mantis: tunal
-
Reporter name: Tunahan ÜNAL
Original Reporter info from Mantis: tunal
- Reporter name: Tunahan ÜNAL
Description:
Generics implementation have problem when Delphi mode is on with following code sapmle.
I'm trying to define generic and enumerable list which is compatible with delphi syntax.
ubase.pas(31,45) Error: Specialization is only supported for generic types
Steps to reproduce:
unit uBase;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
type
TTestEnumerator<T> = class;
TTestList<T> = class
function GetEnumerator : TTestEnumerator<T>; //<<<<< Fails
end;
TTestEnumerator<T> = class
private
FTestList: TTestList<T>;
end;
implementation
function TTestList<T>.GetEnumerator: TBaseListEnumerator<T>;
begin
Result := TTestEnumerator<T>.Create(Self);
end;
Mantis conversion info:
- Mantis ID: 22402
- OS: Windows
- OS Build: 7
- Platform: x86
- Version: 2.6.0
Edited by Sven/Sarah Barth