tgeneric4.pp 560 B

1234567891011121314151617181920212223242526
  1. { %fail }
  2. uses ugeneric4;
  3. procedure LocalFill;
  4. begin
  5. globaldata:='Program';
  6. end;
  7. { The next specialization should not find the LocalFill
  8. defined in the program. It should found the LocalFill
  9. in ugeneric4, but for the moment that is not allowed since
  10. the assembler symbol is not global and will therefor
  11. generate a failure a linking time (PFV) }
  12. type
  13. TMyStringList = specialize TList<string>;
  14. var
  15. slist : TMyStringList;
  16. begin
  17. slist := TMyStringList.Create;
  18. slist.Fill;
  19. writeln(slist.data);
  20. if slist.data<>'Unit' then
  21. halt(1);
  22. end.