From: amado.alves@gmail.com
Subject: Cannot implement with an instantiation?!
Date: Thu, 25 Oct 2007 17:34:06 -0000
Date: 2007-10-25T17:34:06+00:00 [thread overview]
Message-ID: <1193333646.936502.278310@y42g2000hsy.googlegroups.com> (raw)
Ada is being very bad to me. She does not let me instantiate a generic
procedure Generic_Connect nested in a generic package body
Generic_Graphs. Is she in any reason? And how do I make things right?
Thanks a lot.
generic
...
package Generic_Graphs is
...
procedure Connect
(Digraph : in out Digraph_Type;
From, To : Node_Array);
...
end;
package body Generic_Graphs is
...
generic
...
procedure Generic_Connect
(Digraph : in out Digraph_Type;
From, To : Node_Array);
procedure Generic_Connect
(Digraph : in out Digraph_Type;
From, To : Node_Array) is
begin
...
end;
procedure Connect
(Digraph : in out Digraph_Type; -- <== GNAT complains here saying
that a
From, To : Node_Array) -- formal part is not allowed in
an instantiation
is new Generic_Connect (True);
...
end;
That's ok.
But if the offending part is removed then GNAT says that it conflicts
with the declaration in the package spec.
This is silly. I cannot implement an exported entity with a private
instantiation?!
And then if I move the generic procedure declaration and the
instantiation to the spec then it complains that the instantiation
must be done after the body is visible!
Help!!!
next reply other threads:[~2007-10-25 17:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-25 17:34 amado.alves [this message]
2007-10-25 17:41 ` Cannot implement with an instantiation?! Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox