===================================================================
@@ -1331,9 +1331,23 @@
if Ekind (Root_Type (Entity (S))) = E_Incomplete_Type then
Set_Directly_Designated_Type (T, Entity (S));
+
+ -- If the designated type is a limited view, we cannot tell if
+ -- the full view contains tasks, and there is no way to handle
+ -- that full view in a client. We create a master entity for the
+ -- scope, which will be used when a client determines that one
+ -- is needed.
+
+ if From_Limited_With (Entity (S))
+ and then not Is_Class_Wide_Type (Entity (S))
+ then
+ Set_Ekind (T, E_Access_Type);
+ Build_Master_Entity (T);
+ Build_Master_Renaming (T);
+ end if;
+
else
- Set_Directly_Designated_Type (T,
- Process_Subtype (S, P, T, 'P'));
+ Set_Directly_Designated_Type (T, Process_Subtype (S, P, T, 'P'));
end if;
-- If the access definition is of the form: ACCESS NOT NULL ..
===================================================================
@@ -6236,6 +6236,25 @@
Write_Entity_Info (P_Type, " "); Write_Eol;
end if;
+ -- The designated type may be a limited view with no components.
+ -- Check whether the non-limited view is available, because in some
+ -- cases this will not be set when instlling the context.
+
+ if Is_Access_Type (P_Type) then
+ declare
+ D : constant Entity_Id := Directly_Designated_Type (P_Type);
+ begin
+ if Is_Incomplete_Type (D)
+ and then not Is_Class_Wide_Type (D)
+ and then From_Limited_With (D)
+ and then Present (Non_Limited_View (D))
+ and then not Is_Class_Wide_Type (Non_Limited_View (D))
+ then
+ Set_Directly_Designated_Type (P_Type, Non_Limited_View (D));
+ end if;
+ end;
+ end if;
+
-- First check for components of a record object (not the
-- result of a call, which is handled below).