[fpc-pascal] Bug in generics
Yann Mérignac
yann.merignac at gmail.com
Fri Jun 6 14:30:51 CEST 2014
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)
------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140606/1ff64c77/attachment.html>
More information about the fpc-pascal
mailing list