fpc/tests/test/tgeneric4.pp
peter 1e123d66ba * improved generics
git-svn-id: trunk@8838 -
2007-10-18 00:24:05 +00:00

27 lines
560 B
ObjectPascal

{ %fail }
uses ugeneric4;
procedure LocalFill;
begin
globaldata:='Program';
end;
{ The next specialization should not find the LocalFill
defined in the program. It should found the LocalFill
in ugeneric4, but for the moment that is not allowed since
the assembler symbol is not global and will therefor
generate a failure a linking time (PFV) }
type
TMyStringList = specialize TList<string>;
var
slist : TMyStringList;
begin
slist := TMyStringList.Create;
slist.Fill;
writeln(slist.data);
if slist.data<>'Unit' then
halt(1);
end.