comp.lang.ada
 help / color / mirror / Atom feed
* Problem with instantiating generic procedure
@ 1999-07-17  0:00 Markus Kuhn
  1999-07-17  0:00 ` Vladimir Olensky
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Markus Kuhn @ 1999-07-17  0:00 UTC (permalink / raw)


Sorry, but after searching through the RM for almost an hour, I still
haven't figured out what I do wrong here and how I should fix this.
I declare in a package spec a procedure A and I want to implement the
procedure body of A by instantiating a generic procedure G. The following
is the shortest possible program that reproduces my problem:

-- bug.ads --
package Bug is
   
   procedure A;
   
end Bug;
-- bug.adb --
package body Bug is
   
   generic
   procedure G;
   
   procedure G is
   begin
      null;
   end G;
   
   procedure A is new G;
   
end Bug;
-------------

GNAT 3.11p on Linux insists on the following error message:

bug.adb:1:14: missing body for "A" declared at bug.ads:3
bug.adb:11:14: "A" conflicts with declaration at bug.ads:3

What is wrong with simply implementing a procedure declared
in the spec file in the body file by instantiating it from
a generic procedure of the exact same signature? Both A and G
have no parameters, so how can there be a conflict?

It would be nice if GNAT wrote out explicitely the two conflicting
sides, each time it uses the word "conflict" in an error message.

Any idea what is wrong here?

Markus

-- 
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org,  WWW: <http://www.cl.cam.ac.uk/~mgk25/>




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

end of thread, other threads:[~1999-07-23  0:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-17  0:00 Problem with instantiating generic procedure Markus Kuhn
1999-07-17  0:00 ` Vladimir Olensky
1999-07-17  0:00 ` Florian Weimer
1999-07-18  0:00   ` Markus Kuhn
1999-07-18  0:00     ` Florian Weimer
1999-07-19  0:00       ` Robert Dewar
1999-07-19  0:00         ` Florian Weimer
1999-07-18  0:00     ` Chad R. Meiners
1999-07-18  0:00 ` David C. Hoos, Sr.
1999-07-19  0:00 ` Tucker Taft
1999-07-19  0:00   ` Markus Kuhn
1999-07-23  0:00     ` Tucker Taft
1999-07-19  0:00 ` Robert A Duff

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