pascalabcnet/TestSuite/inherited2.pas

16 lines
243 B
ObjectPascal
Raw Permalink Normal View History

2018-06-03 15:48:27 +03:00
type
t1 = class
function p1:byte; virtual := 1;
end;
t2 = class(t1)
function p1:byte; override;
begin
var b:byte := inherited p1;
Result := b;
end;
end;
begin
var o := new t2;
assert(o.p1 = 1);
end.