Hi,

I have found a bug with generics. It exists in 2.6.4 but not in 2.7.1 (rev
27862). I searched in bug tracker but can't find a corresponding bug
report. Should I report it or consider it's fixed ?

Program :
------------------------------------
program genbug_002;

{$mode objfpc}{$h+}

uses
  Classes, SysUtils;

type
  { TAbstractVector }
  TAbstractVector = class
  end;

  { TGenVector }
  generic TGenVector<_TItem_> = class(TAbstractVector)  // ERROR
  end;

  TStringVector = class(specialize TGenVector<String>)
  end;

begin

end.
------------------------------------

Error message :
------------------------------------
Free Pascal Compiler version 2.6.4 [2014/03/03] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling genbug_002.pas
genbug_002.pas(14,54) Error: Identifier not found "TAbstractVector"
genbug_002.pas(14,54) Error: class type expected, but got "<erroneous type>"
genbug_002.pas(25) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not
specify a source file to be compiled)
------------------------------------
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to