From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: GNAT Error? Date: Sat, 17 Feb 2024 01:26:34 +0200 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 8G/gR9dy8omBqpRApAznSgGR7IY6MJf8nwbdsdDId8EWxGmUej Cancel-Lock: sha1:3VfdxzK5ItlLnQ4v9cVrgaP4eU0= sha256:7rTovmOb1E816l4YTOsjzfiRRJCpML1Q8SIudJRbP/4= User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:66066 List-Id: On 2024-02-17 0:51, Jeffrey R.Carter wrote: > I have this code: > > package Alloc_Err is >    type RT is record >       F1 : Integer; >       F2 : Integer; >    end record; > >    type Grid is array (Positive range <>, Positive range <>) of RT with >       Dynamic_Predicate => Grid'First (1) = 1 and Grid'First (2) = 1; > >    procedure What; > end Alloc_Err; > > package Alloc_Err is >    type RT is record >       F1 : Integer; >       F2 : Integer; >    end record; > >    type Grid is array (Positive range <>, Positive range <>) of RT with >       Dynamic_Predicate => Grid'First (1) = 1 and Grid'First (2) = 1; > >    procedure What; > end Alloc_Err; > > and GNAT 12.3.0 and 13.2.0 say > > alloc_err.adb:5:26: error: invalid use of subtype mark in expression or > call > > This doesn't happen if the Dynamic_Predicate is removed. This looks like > an error to me, but I thought I'd better see if there's something I've > missed. 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.