|
@@ -4979,6 +4979,7 @@ implementation
|
|
|
{ true, if self inherits from d (or if they are equal) }
|
|
|
function tobjectdef.is_related(d : tdef) : boolean;
|
|
|
var
|
|
|
+ realself,
|
|
|
hp : tobjectdef;
|
|
|
begin
|
|
|
if self=d then
|
|
@@ -4992,17 +4993,21 @@ implementation
|
|
|
is_related:=false;
|
|
|
exit;
|
|
|
end;
|
|
|
+ realself:=find_real_objcclass_definition(self,false);
|
|
|
+ d:=find_real_objcclass_definition(tobjectdef(d),false);
|
|
|
|
|
|
{ Objective-C protocols can use multiple inheritance }
|
|
|
- if (objecttype=odt_objcprotocol) then
|
|
|
+ if (realself.objecttype=odt_objcprotocol) then
|
|
|
begin
|
|
|
- is_related:=is_related_protocol(self,d);
|
|
|
+ is_related:=is_related_protocol(realself,d);
|
|
|
exit
|
|
|
end;
|
|
|
|
|
|
{ formally declared Objective-C classes match Objective-C classes with
|
|
|
- the same name }
|
|
|
- if (objecttype=odt_objcclass) and
|
|
|
+ the same name (still required even though we looked up the real
|
|
|
+ definitions above, because these may be two different formal
|
|
|
+ declarations) }
|
|
|
+ if (realself.objecttype=odt_objcclass) and
|
|
|
(tobjectdef(d).objecttype=odt_objcclass) and
|
|
|
((oo_is_formal in objectoptions) or
|
|
|
(oo_is_formal in tobjectdef(d).objectoptions)) and
|
|
@@ -5012,7 +5017,7 @@ implementation
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
- hp:=childof;
|
|
|
+ hp:=realself.childof;
|
|
|
while assigned(hp) do
|
|
|
begin
|
|
|
if hp=d then
|