summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw8847.pp
blob: 64331a376198c505f841419e5155b26bd2149cf8 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
{$ifdef fpc}{$mode objfpc}{$h+}{$endif}

uses
  Classes;

type
  tbase = class(tobject)
  public
    function add: tobject; overload;
    function add(aitem: tobject): integer; overload;
  end;

  timpl = class(tbase)
  public
    function add: tpersistent; overload;
    function add(aitem: tpersistent): integer; overload;
  end;

var
  err : boolean;
	
function tbase.add: tobject;
begin
  writeln('tbase.add:tobject');
  result := nil;
end;

function tbase.add(aitem: tobject): integer;
begin
  writeln('tbase.add(aitem: tobject)');
  result := -1;
end;

function timpl.add: tpersistent;
begin
  writeln('timpl.add:tpersistent');
  result := nil;
end;

function timpl.add(aitem: tpersistent): integer;
begin
  writeln('timpl.add(aitem: tpersistent)');
	err:=false;
  result := -1
end;

var
  vimpl: timpl;

begin
  err:=true;
  vimpl := timpl.create;
  vimpl.add(nil);
  vimpl.free;
	if err then
	  halt(1);
end.