if Present (Add_Unnamed_Subp)
and then No (New_Indexed_Subp)
+ and then Etype (Add_Unnamed_Subp) /= Any_Type
then
declare
Elmt_Type : constant Entity_Id :=
end if;
end;
- elsif Present (Add_Named_Subp) then
+ elsif Present (Add_Named_Subp)
+ and then Etype (Add_Named_Subp) /= Any_Type
+ then
declare
-- Retrieves types of container, key, and element from the
-- specified insertion procedure.
end loop;
end;
- elsif Present (Assign_Indexed_Subp) then
+ elsif Present (Assign_Indexed_Subp)
+ and then Etype (Assign_Indexed_Subp) /= Any_Type
+ then
-- Indexed Aggregate. Positional or indexed component
-- can be present, but not both. Choices must be static
-- values or ranges with static bounds.
Aitem := Empty;
when Aspect_Aggregate =>
- if Is_Array_Type (E) then
- Error_Msg_N
- ("aspect% can only be applied to non-array type", Id);
- goto Continue;
- end if;
+ -- We will be checking that the aspect is not specified on a
+ -- non-array type in Check_Aspect_At_Freeze_Point
Validate_Aspect_Aggregate (Expr);
Record_Rep_Item (E, Aspect);
return;
when Aspect_Aggregate =>
+ if Is_Array_Type (Entity (ASN)) then
+ Error_Msg_N
+ ("aspect% can only be applied to non-array type",
+ Identifier (ASN));
+ end if;
Resolve_Aspect_Aggregate (Entity (ASN), Expression (ASN));
return;