tw14849.pp 716 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. { %norun }
  2. { %fail }
  3. unit tw14849;
  4. {$mode objfpc}
  5. interface
  6. uses
  7. Classes, SysUtils;
  8. type
  9. TMarkerState=(leftActive,rightActive);
  10. TWorldPoint=record
  11. fX,fY:double;
  12. end;
  13. TCoolClass = class(TComponent)
  14. private
  15. fMarkerPos:array[TMarkerState] of TWorldPoint;
  16. { private declarations }
  17. public
  18. function LeftMarker :integer;
  19. function RightMarker:integer;
  20. { public declarations }
  21. { error: using function to index property }
  22. property xLPM:double read fMarkerPos[leftMarker].fX write fMarkerPos[leftmarker].fX;
  23. end;
  24. implementation
  25. function TCoolClass.LeftMarker :integer;
  26. begin
  27. Result:=0;
  28. end;
  29. function TCoolClass.RightMarker:integer;
  30. begin
  31. Result:=1;
  32. end;
  33. end.