summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw17675.pp
blob: 4d30458fc18cfb353237b51f1681da27ffc48eab (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
45
program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes;

type

  TBase = class
  private
    function GetCount: Integer;
  public
    property Count: Integer read GetCount;
  end;

  TSub = class(TBase)
  public
    function Count: Integer; overload;
  end;

function TSub.Count: Integer;
begin
  Result := 2;
end;

{ TBase }

function TBase.GetCount: Integer;
begin
  Result := 1;
end;

var
  MySub: TSub;
  i : Integer;
begin
  MySub := TSub.Create;
// uncomment the next line for Fatal Internal error 200111022:
 if MySub.Count <> 2 then
   halt(1);
end.