comp.lang.ada
 help / color / mirror / Atom feed
* Task interface and entries with aliased parameters
@ 2015-10-21  8:54 Hadrien Grasland
  2015-10-21 15:52 ` AdaMagica
  2015-10-21 17:01 ` Jeffrey R. Carter
  0 siblings, 2 replies; 16+ messages in thread
From: Hadrien Grasland @ 2015-10-21  8:54 UTC (permalink / 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


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

end of thread, other threads:[~2015-10-30 19:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21  8:54 Task interface and entries with aliased parameters Hadrien Grasland
2015-10-21 15:52 ` 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

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