Currently the following multidimensional array aggregate is not explicitly illegal, as far as I can tell:
type Arr is array (Positive range <>, Positive range <>) of Integer;
X : Arr := [for I in 1 .. 0 => [for J in I .. I + 1 => 42]];
However, this seems to interfere with RM 4.3.3(22):
Any discrete_choices of this aggregate and of its subaggregates are evaluated in an arbitrary order, and converted to the corresponding index type;
which seems to require that we evaluate all of the discrete_choices even for a null array, and in an arbitrary order, which is not possible given the dependence of the range of J on the value of the index parameter I.
It would seem we need to disallow the use of an outer dimension index parameter in a discrete_choice or iterator_specification of a nested subaggregate. We might modify 4.3.3(17) as follows:
Currently the following multidimensional array aggregate is not explicitly illegal, as far as I can tell:
However, this seems to interfere with RM 4.3.3(22):
which seems to require that we evaluate all of the discrete_choices even for a null array, and in an arbitrary order, which is not possible given the dependence of the range of J on the value of the index parameter I.
It would seem we need to disallow the use of an outer dimension index parameter in a discrete_choice or iterator_specification of a nested subaggregate. We might modify 4.3.3(17) as follows: