blob: 14df4c075a5c4a80c2c7d30514d36a4c46ae3b50 (
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
|
program tb0577;
{$mode delphi}
type
tc = class
procedure test(b: byte);virtual;overload;
end;
tc2 = class(tc)
strict protected
procedure test(b: byte; l: longint = 1234);virtual;overload;
public
procedure test(l: longint);virtual;overload;
end;
tc3 = class(tc2)
procedure test(b: byte);override;overload;
end;
var
glob: longint;
procedure tc.test(b: byte);
begin
glob:=2;
end;
procedure tc2.test(l: longint);
begin
glob:=1;
end;
procedure tc2.test(b: byte; l: longint = 1234);
begin
glob:=3;
end;
procedure tc3.test(b: byte);
begin
inherited;
end;
var
c: tc;
begin
c:=tc3.create;
c.test(byte(4));
if glob<>2 then
halt(1);
end.
|