tw25602.pp 397 B

1234567891011121314151617181920212223242526
  1. {$MODE DELPHI}
  2. type
  3. TA = class
  4. const C = 1;
  5. end;
  6. TB<T> = object
  7. procedure Foo;
  8. end;
  9. procedure TB<T>.Foo;
  10. var
  11. // X: array[0..T.C] of byte = (0); // Error: Expected another 1 array elements
  12. X: array[0..T.C] of byte = (0, 2); // Fatal: Syntax error, ")" expected but "," found
  13. begin
  14. if high(x)<>1 then
  15. halt(1);
  16. writeln('ok');
  17. end;
  18. var
  19. x: TB<TA>;
  20. begin
  21. x.Foo;
  22. end.