Under FPC 2.4.2 I have been using RBTree unit that uses generics. With 2.6.0 it fails to compile. I know that there have been changes for 2.6.0 but I have checked the syntax in the 2.6.0 Language Reference and cannot see why the error is occurring. I have also looked in Mantis but don't know if anything there relates to my problem. I have excerpted the code below and attached the complete unit.
==================
unit FOS_REDBLACKTREE_GEN;
// (c) Copyright FirmOS Business Solutions GmbH
// Author Helmut Hartl, Franz Schober
}
//{$MODE OBJFPC}
{$MODE DELPHI}
{$H+}
interface
type
TRB_NodeColor=(R,B);
{ TGFOS_RBTree }
{$B-}
generic TGFOS_RBTree<_TKey,_TStore> = class(TInterfacedObject)*** The error occurs at the line above.
Free Pascal Compiler version 2.6.0 [2012/02/08] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64
Compiling FOS_REDBLACKTREE_GEN.pas
FOS_REDBLACKTREE_GEN.pas(48,11) Fatal: Syntax error, "=" expected but "identifier TGFOS_RBTREE" found
Fatal: Compilation aborted
type public
PFOS_RB_NodeG=^TFOS_RB_NodeG;
_PStore =^_TStore;
TFOS_RB_NodeG = packed record
k: _TKey;
left, right, parent: PFOS_RB_NodeG;
col: TRB_NodeColor;
val:_TStore;
end;
TCompareKeys = function (const Item1, Item2: _TKey):
Integer;
TGUndefined = function :_Tstore;
TGUndefinedKey = function :_TKey;
TGFOS_RB_OnItem = procedure (const Item:_TStore) of object;
TGFOS_RB_OnItemN = procedure (const Item:_TStore);==================
Thanks for any help.
