Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What I do wrong here?

39 views
Skip to first unread message

reinert

unread,
Sep 22, 2023, 2:25:41 AM9/22/23
to
-- Assume the following ordered_map:

package n_cells1_p is new ada.containers.ordered_maps
(key_type => celltype1_t, element_type => Natural);
use n_cells1_p;
n_cells1 : n_cells1_p.map;

-- This statemanet is OK according to latest gnat (latest alire release):
n_cells1(cells1(e.id).type1) := n_cells1(cells1(e.id).type1) + 1;

-- But the compiler does not like this:
n_cells1(cells1(e.id).type1) := @ + 1;

(giving messages:
error: expected type universal integer
error: found private type "Ada.Containers.Ordered_Maps.Reference_Type" ...

OK, I can live with the first alternative, but I would like to know...

reinert

AdaMagica

unread,
Sep 22, 2023, 12:26:38 PM9/22/23
to
Look like a compiler error. Note that @ is brand new, and your left-hand side is quite complicated..
0 new messages