comp.lang.ada
 help / color / mirror / Atom feed
* Entry family
@ 2002-11-21 11:18 Evangelista Sami
  2002-11-21 11:21 ` Preben Randhol
  0 siblings, 1 reply; 11+ messages in thread
From: Evangelista Sami @ 2002-11-21 11:18 UTC (permalink / raw)


hello all

what is the meaning of this code which compile well with gnat3.14
under linux:
---------------------------------------------
procedure Test_Index is
   type Id is mod 10;
   protected type Prot is
      entry E (Boolean);
   end Prot;
   protected body Prot is
       entry E (for I in Id) when True is
       begin
          null;
       end;
   end Prot;
   P : Prot;
begin
   P.E(True);
end;
---------------------------------------------why can i declare the
index entry of E as Boolean in the spec and as Id in the body?
Perhaps i didnt understand something about entry index

Thanks for any response



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Entry family
@ 2002-11-21 12:14 Grein, Christoph
  2002-11-21 14:18 ` evangeli
  2002-11-22  1:30 ` Randy Brukardt
  0 siblings, 2 replies; 11+ messages in thread
From: Grein, Christoph @ 2002-11-21 12:14 UTC (permalink / raw)


> ---------------------------------------------
> procedure Test_Index is
>    type Id is mod 10;
>    protected type Prot is
>       entry E (Boolean);
>    end Prot;
>    protected body Prot is
>        entry E (for I in Id) when True is
>        begin
>           null;
>        end;
>    end Prot;
>    P : Prot;
> begin
>    P.E(True);
> end;

To me, this looks like a fat compiler bug. The entry body shouod be

  entry E (for I in Boolean) when True is

Report it to ACT (report@gnat.com).



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Entry family
@ 2002-11-22  5:29 Grein, Christoph
  0 siblings, 0 replies; 11+ messages in thread
From: Grein, Christoph @ 2002-11-22  5:29 UTC (permalink / raw)


> >>---------------------------------------------
> >>procedure Test_Index is
> >>   type Id is mod 10;
> >>   protected type Prot is
> >>      entry E (Boolean);
> >>   end Prot;
> >>   protected body Prot is
> >>       entry E (for I in Id) when True is
> >>       begin
> >>          null;
> >>       end;
> >>   end Prot;
> >>   P : Prot;
> >>begin
> >>   P.E(True);
> >>end;
> >>
> --------------------------------------------------
> procedure test_index is
>     type Id is mod 5;
>     protected type Prot is
>        entry E(Id);
>     end Prot;
>     protected body Prot is
>        entry E(for B in boolean) when true is
>        begin
>           null;
>        end;
>     end Prot;
>     P : Prot;
> begin
>     -- OK : 0 -> FALSE
>     P.E(0);
>     -- OK : 1 -> TRUE
>     P.E(1);
>     -- CRASHES
>     P.E(2);
> end;
> --------------------------------------------------

Both programs show the same fat bug. There is no such implicit conversion in 
Ada.

The entry spec and body do not match. Full stop.



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Entry family
@ 2002-11-22 10:49 Grein, Christoph
  0 siblings, 0 replies; 11+ messages in thread
From: Grein, Christoph @ 2002-11-22 10:49 UTC (permalink / raw)


> Could somebody with GNAT 3.15p try it to see if the bug is still there
> or if it was fixed?

It's there even with 3.16w (the wavefront).



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

end of thread, other threads:[~2002-11-23 17:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-21 11:18 Entry family Evangelista Sami
2002-11-21 11:21 ` Preben Randhol
2002-11-21 12:39   ` evangeli
2002-11-21 12:10     ` Preben Randhol
  -- strict thread matches above, loose matches on Subject: below --
2002-11-21 12:14 Grein, Christoph
2002-11-21 14:18 ` evangeli
2002-11-22  1:30 ` Randy Brukardt
2002-11-22 10:39   ` Preben Randhol
2002-11-23 17:21     ` Simon Wright
2002-11-22  5:29 Grein, Christoph
2002-11-22 10:49 Grein, Christoph

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