|
@@ -2216,6 +2216,7 @@ implementation
|
|
function is_visible_for_object(symst:tsymtable;symvisibility:tvisibility;contextobjdef:tabstractrecorddef):boolean;
|
|
function is_visible_for_object(symst:tsymtable;symvisibility:tvisibility;contextobjdef:tabstractrecorddef):boolean;
|
|
var
|
|
var
|
|
symownerdef : tabstractrecorddef;
|
|
symownerdef : tabstractrecorddef;
|
|
|
|
+ nonlocalst : tsymtable;
|
|
begin
|
|
begin
|
|
result:=false;
|
|
result:=false;
|
|
|
|
|
|
@@ -2224,17 +2225,22 @@ implementation
|
|
not (symst.symtabletype in [objectsymtable,recordsymtable]) then
|
|
not (symst.symtabletype in [objectsymtable,recordsymtable]) then
|
|
internalerror(200810285);
|
|
internalerror(200810285);
|
|
symownerdef:=tabstractrecorddef(symst.defowner);
|
|
symownerdef:=tabstractrecorddef(symst.defowner);
|
|
|
|
+ { specializations might belong to a localsymtable or parasymtable }
|
|
|
|
+ nonlocalst:=symownerdef.owner;
|
|
|
|
+ if tstoreddef(symst.defowner).is_specialization then
|
|
|
|
+ while nonlocalst.symtabletype in [localsymtable,parasymtable] do
|
|
|
|
+ nonlocalst:=nonlocalst.defowner.owner;
|
|
case symvisibility of
|
|
case symvisibility of
|
|
vis_private :
|
|
vis_private :
|
|
begin
|
|
begin
|
|
{ private symbols are allowed when we are in the same
|
|
{ private symbols are allowed when we are in the same
|
|
module as they are defined }
|
|
module as they are defined }
|
|
result:=(
|
|
result:=(
|
|
- (symownerdef.owner.symtabletype in [globalsymtable,staticsymtable]) and
|
|
|
|
- (symownerdef.owner.iscurrentunit)
|
|
|
|
|
|
+ (nonlocalst.symtabletype in [globalsymtable,staticsymtable]) and
|
|
|
|
+ (nonlocalst.iscurrentunit)
|
|
) or
|
|
) or
|
|
( // the case of specialize inside the generic declaration and nested types
|
|
( // the case of specialize inside the generic declaration and nested types
|
|
- (symownerdef.owner.symtabletype in [objectsymtable,recordsymtable]) and
|
|
|
|
|
|
+ (nonlocalst.symtabletype in [objectsymtable,recordsymtable]) and
|
|
(
|
|
(
|
|
assigned(current_structdef) and
|
|
assigned(current_structdef) and
|
|
(
|
|
(
|
|
@@ -2286,8 +2292,8 @@ implementation
|
|
in the current module }
|
|
in the current module }
|
|
result:=(
|
|
result:=(
|
|
(
|
|
(
|
|
- (symownerdef.owner.symtabletype in [globalsymtable,staticsymtable]) and
|
|
|
|
- (symownerdef.owner.iscurrentunit)
|
|
|
|
|
|
+ (nonlocalst.symtabletype in [globalsymtable,staticsymtable]) and
|
|
|
|
+ (nonlocalst.iscurrentunit)
|
|
) or
|
|
) or
|
|
(
|
|
(
|
|
assigned(contextobjdef) and
|
|
assigned(contextobjdef) and
|
|
@@ -2296,7 +2302,7 @@ implementation
|
|
def_is_related(contextobjdef,symownerdef)
|
|
def_is_related(contextobjdef,symownerdef)
|
|
) or
|
|
) or
|
|
( // the case of specialize inside the generic declaration and nested types
|
|
( // the case of specialize inside the generic declaration and nested types
|
|
- (symownerdef.owner.symtabletype in [objectsymtable,recordsymtable]) and
|
|
|
|
|
|
+ (nonlocalst.symtabletype in [objectsymtable,recordsymtable]) and
|
|
(
|
|
(
|
|
assigned(current_structdef) and
|
|
assigned(current_structdef) and
|
|
(
|
|
(
|