On 2024-02-17 00:26, Niklas Holsti wrote:
>
> You showed two copies of the declaration (spec) of package Alloc_Err, but you
> did not show the body of the package. Based on the error message pointing to
> alloc_err.adb (and not .ads), GNAT thinks the error is in the body. Please show
> the body of the package.
>
Oops. Well, I've managed to simplify the reproducer to
procedure Alloc2 is
type Grid is array (Positive range <>, Positive range <>) of Integer with
Dynamic_Predicate => Grid'First (1) = 1 and Grid'First (2) = 1;
type Grid_Ptr is access Grid;
Data : Grid_Ptr := new Grid (1 .. 10, 1 .. 20);
begin -- Alloc2
null;
end Alloc2;
which results in
alloc2.adb:7:23: error: invalid use of subtype mark in expression or call
Line 7 is the declaration of Data.