tbug555a.pp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. { FPC behaves interestingly once encountered virtual method
  2. declared as
  3. procedure TWhateverObject.Method1; assembler; asm ... end;
  4. if you ever try to overload such method _in another unit_,
  5. than compile _second unit_, and than try to compile it again (???)-
  6. you will end up with the message "Function header does not match
  7. forward declaration of TNewObject.Method1" although in reality
  8. it does match perfectly.
  9. sometimes i encounter the same message even on non-assembler methods,
  10. but i have not been able to reproduce them cleanly nor find the
  11. reason for such behavior.}
  12. unit tbug555a;
  13. interface
  14. type
  15. TBugObj = Object
  16. constructor Init;
  17. procedure Method1;
  18. procedure Method2;virtual;
  19. procedure Method3;
  20. procedure Method4;virtual;
  21. destructor Done;virtual;
  22. end;
  23. implementation
  24. Constructor TBugObj.Init;
  25. begin
  26. end;
  27. {$ASMMODE ATT}
  28. procedure TBugObj.Method1;assembler;
  29. asm
  30. movl $1,%eax
  31. end;
  32. procedure TBugObj.Method2;assembler;
  33. asm
  34. movl $1,%eax
  35. end;
  36. procedure TBugObj.Method3;
  37. begin
  38. end;
  39. procedure TBugObj.Method4;
  40. begin
  41. end;
  42. Destructor TBugObj.Done;
  43. begin
  44. end;
  45. end.