summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbf/tw3488.pp
blob: 12985c07ad5b7f4aabb652885ef4b4e2695fa004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ %fail }

{ Source provided for Free Pascal Bug Report 3488 }
{ Submitted by "Jesus Reyes A." on  2004-12-28 }
{ e-mail: jesusrmx@yahoo.com.mx }
program opertest;

{$mode objfpc}{$H+}

type
  TBug=class
  private
    FField: Integer;
    procedure SetField(const AValue: Integer);
  public
    property Field: Integer read FField write SetField;
  end;

procedure TBug.SetField(const aValue: Integer);
begin
  WriteLn('SetField visited');
  FField := AValue;
end;

var
  Bug: TBug;
begin
  Bug := TBug.Create;
  Bug.Field := 10;

  { This is not allowed with properties }
  Bug.Field += 1;

  WriteLn('Bug.Field=',Bug.Field);
end.