Root_Type does not return the same type for the private and the full view of
a derived private tagged type when both derive from an interface type.
gcc/ada/ChangeLog:
* sem_ch12.adb (Copy_Generic_Node): Do not call Root_Type to find
the root type of an aggregate of a derived tagged type.
and then Nkind (Ancestor_Type (N)) in N_Entity
then
declare
- Root_Typ : constant Entity_Id :=
- Root_Type (Ancestor_Type (N));
-
Typ : Entity_Id := Ancestor_Type (N);
begin
Switch_View (Typ);
end if;
- exit when Typ = Root_Typ;
+ exit when Etype (Typ) = Typ;
Typ := Etype (Typ);
end loop;