[fpc-devel] Generics syntax error

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Sep 22 15:59:01 CEST 2010


Hello,

Has anyone experienced issues with generics? I have the following code:

unit cdescreen;

{$mode delphi}

interface

uses
  // LCL, RTL, FCL
  Classes, SysUtils, Controls, Graphics, LCLType, SDFData, fpimage,
  fgl,
  //
  cdeconfig, cdeprovinces, cdeutils, cdegame, cdetypes, dlgstatus;

type

  TCDEScreen = class;

  { TCDEDrawerDelegate }

  TCDEDrawerDelegate = class
  public
    Owner: TCDEScreen;
    procedure HandleMouseDown(Sender: TObject; Button: TMouseButton;
Shift:TShiftState; X,Y:Integer); virtual; abstract;
    procedure HandleMouseUp(Sender: TObject; Button: TMouseButton;
Shift:TShiftState; X,Y:Integer); virtual; abstract;
    procedure HandleMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer); virtual; abstract;
    procedure Prepare; virtual; abstract;
  end;

  TDrawerDelegateList = specialize TFPGList<TCDEDrawerDelegate>;
...
cdescreen.pas(29,63) Fatal: Syntax error, ";" expected but ">" found

If I change the line to   TDrawerDelegateList = specialize
TFPGList<TCDEDrawerDelegate;

then it says:

cdescreen.pas(29,63) Fatal: Syntax error, ">" expected but ";" found

o.O FPC 2.4.0 on Windows

I couldn't find anything in the bug tracker

Changing the mode to objfpc doesn't change anything

thanks,
-- 
Felipe Monteiro de Carvalho



More information about the fpc-devel mailing list