4.3.2 Extension Aggregates
An
extension_aggregate
specifies a value for a type that is a record extension by specifying
a value or subtype for an ancestor of the type, followed by associations
for any components not determined by the
ancestor_part.
Syntax
Name Resolution Rules
Legality Rules
a call to a function with an unconstrained result
subtype; nor
a parenthesized or qualified expression whose operand
would violate this rule; nor
Static Semantics
Dynamic Semantics
9 If the
ancestor_part
is a
subtype_mark,
then its type can be abstract. If its type is controlled, then as the
last step of evaluating the aggregate, the Initialize procedure of the
ancestor type is called, unless the Initialize procedure is abstract
(see
7.6).
Examples
Examples of extension
aggregates (for types defined in 3.9.1):
Painted_Point'(Point with Red)
(Point'(P) with Paint => Black)
(Expression with Left => 1.2, Right => 3.4)
Addition'(Binop with null record)
-- presuming Binop is of type Binary_Operation
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe