tw1483.pp 519 B

1234567891011121314151617181920212223242526272829303132
  1. { %fail }
  2. Type pBug=^tBug;
  3. tBug=Object
  4. Private
  5. A:Longint;
  6. Go:Procedure Of Object;
  7. Procedure Go1;
  8. Public
  9. Constructor Init;
  10. End;
  11. Constructor tBug.Init;
  12. Begin
  13. A:=10;
  14. Go:=Go1; { <-- It's wring, it should }
  15. { be Go:=@Go1; but compiler }
  16. { says it's ok, and the program}
  17. { even runs... }
  18. End;
  19. Procedure tBug.Go1;
  20. Begin
  21. WriteLn(A);
  22. End;
  23. Var Bug:pBug;
  24. Begin
  25. Bug:=New(pBug,Init);
  26. Bug^.Go;
  27. End.