---------------------
 
    function Designated_Type (Id : E) return E is
-      Desig_Type : E;
+      Desig_Type : Entity_Id;
 
    begin
       Desig_Type := Directly_Designated_Type (Id);
    ---------------------
 
    function First_Component (Id : E) return E is
-      Comp_Id : E;
+      Comp_Id : Entity_Id;
 
    begin
       pragma Assert
    -------------------------------------
 
    function First_Component_Or_Discriminant (Id : E) return E is
-      Comp_Id : E;
+      Comp_Id : Entity_Id;
 
    begin
       pragma Assert
    ------------------
 
    function First_Formal (Id : E) return E is
-      Formal : E;
+      Formal : Entity_Id;
 
    begin
       pragma Assert
    ------------------------------
 
    function First_Formal_With_Extras (Id : E) return E is
-      Formal : E;
+      Formal : Entity_Id;
 
    begin
       pragma Assert
    -----------------
 
    function Last_Formal (Id : E) return E is
-      Formal : E;
+      Formal : Entity_Id;
 
    begin
       pragma Assert
    --------------------
 
    function Next_Component (Id : E) return E is
-      Comp_Id : E;
+      Comp_Id : Entity_Id;
 
    begin
       Comp_Id := Next_Entity (Id);
    ------------------------------------
 
    function Next_Component_Or_Discriminant (Id : E) return E is
-      Comp_Id : E;
+      Comp_Id : Entity_Id;
 
    begin
       Comp_Id := Next_Entity (Id);
    -----------------
 
    function Next_Formal (Id : E) return E is
-      P : E;
+      P : Entity_Id;
 
    begin
       --  Follow the chain of declared entities as long as the kind of the
    ---------------
 
    function Root_Type (Id : E) return E is
-      T, Etyp : E;
+      T, Etyp : Entity_Id;
 
    begin
       pragma Assert (Nkind (Id) in N_Entity);
 
          when Array_Kind =>
             declare
-               Index : E;
+               Index : Entity_Id;
 
             begin
                Write_Attribute