comp.lang.ada
 help / color / mirror / Atom feed
* formal package question
@ 2011-02-14  2:46 ytomino
  2011-02-14  6:51 ` anon
  2011-02-14  9:59 ` Georg Bauhaus
  0 siblings, 2 replies; 9+ messages in thread
From: ytomino @ 2011-02-14  2:46 UTC (permalink / raw)


Hello,
Please look this code:

--------
package formalpkg is

   generic
      type T is private;
      with procedure P (X : T) is <>;
   package F is
   end F;

   generic
      with package FA is new F (others => <>);
   package B is
   end B;

   procedure P1 (X : Character) is null;
   package F1 is new F (Character, P1); -- use P => P1

   package B1 is new B (F1); -- Error !!

   procedure P (X : Character) is null;
   package F2 is new F (Character); -- P => P

   package B2 is new B (F2); -- OK

end formalpkg;
--------
% gnatmake formalpkg.ads
gcc -c formalpkg.ads
formalpkg.ads:17:25: actual for "P" in actual instance does not match
formal
gnatmake: "formalpkg.ads" compilation error
--------

B1 was compile error, but B2 is ok. Why?
Where is wrong in my code?
I want to use instances of generic package with some different
subprograms like B1...

(I use gcc-4.5.1)



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

end of thread, other threads:[~2011-02-17  7:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14  2:46 formal package question ytomino
2011-02-14  6:51 ` anon
2011-02-15  0:08   ` ytomino
2011-02-14  9:59 ` Georg Bauhaus
2011-02-14 15:38   ` Adam Beneschan
2011-02-15  0:31   ` ytomino
2011-02-15  8:17     ` Ludovic Brenta
2011-02-17  0:58       ` ytomino
2011-02-17  7:05         ` Ludovic Brenta

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