declare
D : constant Entity_Id := Directly_Designated_Type (Etype (F1));
Partial_View_Of_Desig : constant Entity_Id :=
- Incomplete_Or_Partial_View (D);
+ Incomplete_Or_Partial_View (D, Partial_Only => True);
begin
return No (Partial_View_Of_Desig)
or else Is_Tagged_Type (Partial_View_Of_Desig)
-- Incomplete_Or_Partial_View --
--------------------------------
- function Incomplete_Or_Partial_View (Id : Entity_Id) return Entity_Id is
+ function Incomplete_Or_Partial_View
+ (Id : Entity_Id; Partial_Only : Boolean := False) return Entity_Id
+ is
S : constant Entity_Id := Scope (Id);
function Inspect_Decls
and then (Is_Incomplete_Type (Prev) or else Ekind (Prev) = E_Constant)
and then Present (Full_View (Prev))
and then Full_View (Prev) = Id
+ and then not Partial_Only
then
return Prev;
end if;
Pkg_Decl : constant Node_Id := Package_Specification (S);
begin
- -- It is knows that Typ has a private view, look for it in the
+ -- It is known that Typ has a private view, look for it in the
-- visible declarations of the enclosing scope. A special case
-- of this is when the two views have been exchanged - the full
-- appears earlier than the private.
-- Taft amendment type. The incomplete view should be located in
-- the private declarations of the enclosing scope.
- elsif In_Package_Body (S) then
+ elsif In_Package_Body (S) and then not Partial_Only then
return Inspect_Decls (Private_Declarations (Pkg_Decl), True);
end if;
end;
-- package specification. The package must be on the scope stack, and the
-- corresponding private part must not.
- function Incomplete_Or_Partial_View (Id : Entity_Id) return Entity_Id;
+ function Incomplete_Or_Partial_View
+ (Id : Entity_Id; Partial_Only : Boolean := False) return Entity_Id;
-- Given the entity of a constant or a type, retrieve the incomplete or
- -- partial view of the same entity. Note that Id may not have a partial
+ -- partial view of the same entity. If Partial_Only is True, retrieve
+ -- only the partial view of a type. Note that Id may not have a partial
-- view in which case the function returns Empty.
function Incomplete_View_From_Limited_With