fpc/tests/tbs/tb0577.pp
Jonas Maebe 9195506c56 * make sure that anonymous inherited calls only call through to the
overridden method, rather than to any method that can accept similar
    parameters as the current one (Delphi-compatible, and corresponds to
    what is described in our documentation)
  * do not flag "inherited" call nodes that are not "anonymous inherited"
    calls using the cnf_anon_inherited flag

git-svn-id: trunk@18162 -
2011-08-10 17:26:19 +00:00

52 lines
749 B
ObjectPascal

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.