tw3241.pp 698 B

12345678910111213141516171819202122232425262728293031323334353637
  1. { %fail }
  2. { Source provided for Free Pascal Bug Report 3241 }
  3. { Submitted by "Mattias Gaertner" on 2004-08-09 }
  4. { e-mail: [email protected] }
  5. program TwoDefaults;
  6. {$mode objfpc}{$H+}
  7. uses
  8. Classes, SysUtils;
  9. type
  10. TMyClass = class
  11. private
  12. function GetA1(Index: integer): integer;
  13. function GetA2(Index: integer): integer;
  14. public
  15. property A1[Index: integer]: integer read GetA1; default;
  16. { Next line should give an error }
  17. property A2[Index: integer]: integer read GetA2; default;
  18. end;
  19. { TMyClass }
  20. function TMyClass.GetA1(Index: integer): integer;
  21. begin
  22. Result:=0;
  23. end;
  24. function TMyClass.GetA2(Index: integer): integer;
  25. begin
  26. Result:=0;
  27. end;
  28. begin
  29. end.