tw3375.pp 404 B

123456789101112131415161718192021222324
  1. { %fail }
  2. { Source provided for Free Pascal Bug Report 3375 }
  3. { Submitted by "Vincent Snijders" on 2004-10-29 }
  4. { e-mail: [email protected] }
  5. program typecast;
  6. {$mode objfpc}{$H+}
  7. type
  8. T4bytes = array[0..3] of byte;
  9. var
  10. w: word;
  11. p: pchar;
  12. a: T4bytes;
  13. begin
  14. w := 0;
  15. // The next line should compile, delphi compatible
  16. p := pchar(w);
  17. // should fail, and it does
  18. a := T4Bytes(w);
  19. end.