Ada Reference Manual (Ada 2022) — Legal Information

# 4.3 Aggregates

1
An aggregate combines component values into a composite value of an array type, record type, or record extension.

#### Syntax

2/5
aggregate ::=
record_aggregate | extension_aggregate | array_aggregate
| delta_aggregate | container_aggregate

#### Name Resolution Rules

3/5
The expected type for an aggregate shall be a single array type, a single type with the Aggregate aspect specified, or a single descendant of a record type or of a record extension.

#### Legality Rules

4/5
A record_aggregate or extension_aggregate shall not be of a class-wide type.

#### Dynamic Semantics

5
For the evaluation of an aggregate, an anonymous object is created and values for the components or ancestor part are obtained (as described in the subsequent subclause for each kind of the aggregate) and assigned into the corresponding components or ancestor part of the anonymous object. Obtaining the values and the assignments occur in an arbitrary order. The value of the aggregate is the value of this object.
6
If an aggregate is of a tagged type, a check is made that its value belongs to the first subtype of the type. Constraint_Error is raised if this check fails.

Ada 2005 and 2012 Editions sponsored in part by Ada-Europe