comp.lang.ada
 help / color / mirror / Atom feed
* Error: container cannot be indexed with "Cursor"
@ 2025-08-08 20:22 Blady
  2025-08-09 14:25 ` Blady
  0 siblings, 1 reply; 2+ messages in thread
From: Blady @ 2025-08-08 20:22 UTC (permalink / raw)


Hello,

Container type UX is declared as:
    type UX is tagged private with
      Constant_Indexing => Constant_Reference, Variable_Indexing => 
Reference, Default_Iterator => Iterate,
      Iterator_Element  => Character,
      Aggregate => (Empty => Empty, Add_Unnamed => Append, New_Indexed 
=> New_Vector, Assign_Indexed => Replace_Element);


I declare:

S3 : UX;
...
80.    for I in S3.Iterate loop
82.       if F then
83.          S3(I) := 'e';
84.       end if;
85.       C := S3 (I);
87.    end loop;

GNAT 15 issues the errors:
test.adb:83:10: error: container cannot be indexed with "Cursor"
test.adb:85:14: error: container cannot be indexed with "Cursor"

Prior GNAT versions didn't issued any errors.

Is there a change in Ada standard? or GNAT?
Why is cursor indexing not possible?

Thanks for your answers, Pascal.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Error: container cannot be indexed with "Cursor"
  2025-08-08 20:22 Error: container cannot be indexed with "Cursor" Blady
@ 2025-08-09 14:25 ` Blady
  0 siblings, 0 replies; 2+ messages in thread
From: Blady @ 2025-08-09 14:25 UTC (permalink / raw)


Le 08/08/2025 à 22:22, Blady a écrit :
> Hello,
> 
> Container type UX is declared as:
>     type UX is tagged private with
>       Constant_Indexing => Constant_Reference, Variable_Indexing => 
> Reference, Default_Iterator => Iterate,
>       Iterator_Element  => Character,
>       Aggregate => (Empty => Empty, Add_Unnamed => Append, New_Indexed 
> => New_Vector, Assign_Indexed => Replace_Element);
> 
> 
> I declare:
> 
> S3 : UX;
> ...
> 80.    for I in S3.Iterate loop
> 82.       if F then
> 83.          S3(I) := 'e';
> 84.       end if;
> 85.       C := S3 (I);
> 87.    end loop;
> 
> GNAT 15 issues the errors:
> test.adb:83:10: error: container cannot be indexed with "Cursor"
> test.adb:85:14: error: container cannot be indexed with "Cursor"
> 
> Prior GNAT versions didn't issued any errors.
> 
> Is there a change in Ada standard? or GNAT?
> Why is cursor indexing not possible?

Same with of form:
   for CC of S2 loop
error: container cannot be indexed with "Cursor"

Compiler bug?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-09 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-08 20:22 Error: container cannot be indexed with "Cursor" Blady
2025-08-09 14:25 ` Blady

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