tw2318.pp 729 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. { Source provided for Free Pascal Bug Report 2318 }
  2. { Submitted by "Sergey Kosarevsky" on 2003-01-09 }
  3. { e-mail: [email protected] }
  4. {$static on}
  5. Type tObject=Object
  6. Constructor Init;
  7. Function GetVMT:Pointer;Static;
  8. Destructor Done;Virtual;
  9. End;
  10. Constructor tObject.Init;
  11. Begin
  12. End;
  13. Function tObject.GetVMT:Pointer;
  14. Begin
  15. GetVMT:=Typeof(self);
  16. End;
  17. Destructor tObject.Done;
  18. Begin
  19. End;
  20. Var O:tObject;
  21. Begin
  22. O.Init;
  23. if (O.GetVMT= nil) or (O.getVMT<>tObject.GetVMT) then
  24. begin
  25. Writeln('Problem with static methods');
  26. Writeln('O.getVMT=',hexstr(longint(O.getVMT),8));
  27. Writeln('tObject.GetVMT=',hexstr(longint(tobject.GetVMT),8));
  28. halt(1);
  29. end;
  30. End.