fpc/tests/webtbs/tw29367.pp
Jonas Maebe ae087b92d7 * when creating a unique type alias for an object, class or interface,
create a child object/class/interface instead of a copy of the original.
    This fixes override/inheritance checks, and is also Delphi-compatible

git-svn-id: trunk@37927 -
2018-01-07 12:25:16 +00:00

31 lines
458 B
ObjectPascal

program Project1;
{$Mode objfpc}
type
TFoo = class
constructor create; virtual;
end;
TBar = type TFoo;
TBaz = class(TBar)
constructor create; override;
end;
constructor TFoo.create;
begin end;
constructor TBaz.create;
begin end;
begin
if not tbar.inheritsfrom(tfoo) then
halt(1);
if not tbaz.inheritsfrom(tbar) then
halt(2);
if tbar.classname<>'TBar' then
halt(3);
if tfoo.classname<>'TFoo' then
halt(4);
end.