summaryrefslogtreecommitdiff
path: root/tests/webtbf/tw15594b.pp
blob: 7871b1f8cfdbbbf419ccf587fc001f27eb4a22d3 (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
36
37
38
39
40
41
42
43
44
{ %fail }

program project1;

{$mode objfpc}{$H+}

type
  
  { TBoolObject }

  TBoolObject = class(TObject)
  private
    fBool: Boolean;
    procedure SetBool(const AValue: Boolean);
  
  protected
    function GetBool: Boolean;
    property Bool: Boolean read GetBool write SetBool default True;
  end;
  
  TSubBoolObject = class(TBoolObject)
  published
    property Bool default True;
  end;

{ TBoolObject }

procedure TBoolObject.SetBool(const AValue: Boolean);
begin
  fBool:=AValue;
end;

function TBoolObject.GetBool: Boolean; 
begin
  Result:=fBool;
end;
  
var
  b: TSubBoolObject;
begin
  b:=TSubBoolObject.Create;
  b.Bool=False; // error: Illegal expression
  b.Free;
end.