comp.lang.ada
 help / color / mirror / Atom feed
* Instantiation problem in generic.
@ 2003-07-22  9:33 Bobby D. Bryant
  2003-07-22 18:26 ` Randy Brukardt
  0 siblings, 1 reply; 2+ messages in thread
From: Bobby D. Bryant @ 2003-07-22  9:33 UTC (permalink / raw)



Am I interpreting this GNAT message correctly? (the compiler is GNAT 3.15p)

For the code in the body of a generic library package (pardon the
wrapping) -

-- Set up callbacks for the window manager's decorations:
GTK_Stuff.Widget_Callback_Returning_Boolean.Connect
   (Widget => Histogram_Window,
    Name   => "delete_event",
    Marsh  => GTK_Stuff.Widget_Callback_Returning_Boolean.To_Marshaller
                 (Close_Histogram_Window_Fn'Access));
--
GTK_Stuff.Widget_Callback.Connect
   (Widget => Histogram_Window,
    Name   => "destroy",
    Marsh  => GTK_Stuff.Widget_Callback.To_Marshaller
                 (Close_Histogram_Window'Access));

I get error messages when compiling the package body (line numbers off due
to Usenet wrapping) -

746. Marsh  => GTK_Stuff.Widget_Callback_Returning_Boolean.To_Marshaller
                  (Close_Histogram_Window_Fn'Access));
        >>> access type must not be outside generic body

750. Marsh  => GTK_Stuff.Widget_Callback.To_Marshaller
                  (Close_Histogram_Window'Access));
        >>> access type must not be outside generic body

The Close_Histogram_* subprograms are defined within the body of the
generic package, so I don't understand what the compiler is complaining
about.

If I put declarations in the package spec, whether in the public area or
the private area, the message is suppressed when compiling the package,
but it still occurs when compiling the program that instantiates it.

Any suggestions?

-- 
Bobby Bryant
Austin, Texas




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

end of thread, other threads:[~2003-07-22 18:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-22  9:33 Instantiation problem in generic Bobby D. Bryant
2003-07-22 18:26 ` Randy Brukardt

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