if Present (Add_Unnamed_Subp)
and then No (New_Indexed_Subp)
- and then Present (Etype (Add_Unnamed_Subp))
- and then Etype (Add_Unnamed_Subp) /= Any_Type
+ and then Present (Entity (Add_Unnamed_Subp))
+ and then Entity (Add_Unnamed_Subp) /= Any_Id
then
declare
Elmt_Type : constant Entity_Id :=
end;
elsif Present (Add_Named_Subp)
- and then Etype (Add_Named_Subp) /= Any_Type
+ and then Present (Entity (Add_Named_Subp))
+ and then Entity (Add_Named_Subp) /= Any_Id
then
declare
-- Retrieves types of container, key, and element from the
end;
elsif Present (Assign_Indexed_Subp)
- and then Etype (Assign_Indexed_Subp) /= Any_Type
+ and then Present (Entity (Assign_Indexed_Subp))
+ and then Entity (Assign_Indexed_Subp) /= Any_Id
then
-- Indexed Aggregate. Positional or indexed component
-- can be present, but not both. Choices must be static
--- /dev/null
+-- PR ada/120665
+-- { dg-do compile }
+-- { dg-options "-gnat2022" }
+
+package Aggr8 is
+
+ type T is null record
+ with Aggregate => (Empty => Empty, Add_Named => Add_Named);
+
+ function Empty return T is ([]); -- { dg-warning "empty|infinite" }
+
+ procedure Add_Named (this : in out T; k : Integer; v : Integer) is null;
+
+end Aggr8;