comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: GNAT Error?
Date: Sat, 17 Feb 2024 01:26:34 +0200	[thread overview]
Message-ID: <l3a99aFjrfbU1@mid.individual.net> (raw)
In-Reply-To: <uqootl$3rue0$1@dont-email.me>

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.

  reply	other threads:[~2024-02-16 23:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 22:51 GNAT Error? Jeffrey R.Carter
2024-02-16 23:26 ` Niklas Holsti [this message]
2024-02-16 23:45   ` Jeffrey R.Carter
2024-02-17  6:04     ` Randy Brukardt
2024-02-17  6:11       ` Jeffrey R.Carter
2024-02-18  9:48         ` Simon Wright
2024-02-18  9:59           ` Simon Wright
2024-02-18 11:48             ` Jeffrey R.Carter
2024-02-18 14:33               ` Simon Wright
2024-03-07 14:54                 ` Simon Wright
2024-03-07 15:06                   ` Jeffrey R.Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox