summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/tbs/tb0259.pp
blob: c436bb60c30a6c475d0e20f28b1fd08fa24585ab (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
{ Old file: tbs0302.pp }
{ inherited property generates wrong assembler         OK 0.99.13 (PFV) }

{$ifdef fpc}{$mode objfpc}{$endif}
type
  c1=class
    Ffont : longint;
    property Font:longint read Ffont write Ffont;
  end;

  c2=class(c1)
    function GetFont:longint;
    procedure setfont(l: longint);
  end;

function c2.GetFont:longint;
begin
  result:=inherited Font;
end;


procedure c2.SetFont(l: longint);
begin
  inherited font := l;  
end;

var
  c: c2;
begin
  c:=c2.create;
  c.ffont:=5;
  if c.getfont<>5 then
    halt(1);
  c.setfont(10);
  if c.getfont<>10 then
    halt(2);
  if c.ffont<>10 then
    halt(3);
end.