comp.lang.ada
 help / color / mirror / Atom feed
From: Hadrien Grasland <hadrien.grasland@gmail.com>
Subject: Task interface and entries with aliased parameters
Date: Wed, 21 Oct 2015 01:54:17 -0700 (PDT)
Date: 2015-10-21T01:54:17-07:00	[thread overview]
Message-ID: <98fcf225-fdec-401c-80b3-321e2ac65f6b@googlegroups.com> (raw)

Hello,

Using GNAT GPL 2015, I am having some trouble with task interfaces which feature entries that take aliased parameters.

Whenever I try to implement one, GNAT refuses to compile the resulting code, claiming that my implementation does not match the associated interface. However, I am pretty convinced that it does. What I would like to know is if I am getting task interfaces wrong, or if this is a bug in GNAT that I should report.

Here is a basic code example that reproduces the problem :

===============================

procedure Main is

   -- Define a task interface with one method having an aliased output
   package Aliased_Entry_Params is
      type Aliased_Interface is task interface;
      procedure Aliased_Entry (Object : Aliased_Interface; Output : aliased out Integer) is abstract;
   end Aliased_Entry_Params;
   
   -- This task should implement the interface... but GNAT claims it doesn't
   task Aliased_Task is new Aliased_Entry_Params.Aliased_Interface with
      overriding entry Aliased_Entry (Output : aliased out Integer);
   end Aliased_Task;
   
   -- Dummy body
   task body Aliased_Task is
   begin
      accept Aliased_Entry (Output : aliased out Integer) do
         Output'Access.all := -256;
      end Aliased_Entry;
   end Aliased_Task;
   
begin
   null;
end Main;

===============================

And here is the GNAT compilation output on my computer :

main.adb:13:24: not subtype conformant with operation inherited at line 12
main.adb:13:24: aliased parameter mismatch
main.adb:13:24: not subtype conformant with declaration at line 7
main.adb:13:24: aliased parameter mismatch
gprbuild: *** compilation phase failed

Thanks in advance for your help !
Hadrien


             reply	other threads:[~2015-10-21  8:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-21  8:54 Hadrien Grasland [this message]
2015-10-21 15:52 ` Task interface and entries with aliased parameters AdaMagica
2015-10-21 17:01 ` Jeffrey R. Carter
2015-10-21 18:06   ` Hadrien Grasland
2015-10-21 19:21   ` Dmitry A. Kazakov
2015-10-21 19:45     ` Hadrien Grasland
2015-10-21 20:19       ` Dmitry A. Kazakov
2015-10-21 19:46     ` Jeffrey R. Carter
2015-10-21 19:59       ` Dmitry A. Kazakov
2015-10-28 17:48     ` Randy Brukardt
2015-10-28 19:34       ` Bob Duff
2015-10-28 22:23         ` Randy Brukardt
2015-10-28 19:47       ` Paul Rubin
2015-10-28 22:24         ` Randy Brukardt
2015-10-28 21:13       ` Dmitry A. Kazakov
2015-10-30 19:48       ` Eryndlia Mavourneen
replies disabled

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