The error seems off to me. What I found was it was your "use
Gnoga.Gui.Element" line. In seems to expose the On_Destroy from
Gnoga.Gui.Base into scope so that your On_Destroy method and the one in
Gnoga.Gui.Base conflict somehow.
Taking out the use and adding to Gnoga.Gui.Element. to the various calls is
an alternate way of fixing it.
I'm not sure why the two procedures conflict. They have different
signatures, and the conflicting procedure isn't even in the package that is
"use"ed
This might be a question for comp.lang.ada. If I get time later, I'll try
and parse through the RM to see if this is a bug or not, but it does seem
odd. Maybe inherited functions of tagged types get exposed to the package
that extends those types. If so, that is why On_Destroy would conflict in
your call. Going only by the name of the procedure with not context, it
happens to chose the one from Gnoga.Gui.Base, which doesn't match the
Action_Event prototype.
On Sun, May 14, 2017 at 4:33 AM, Pascal <blady-...@users.sf.net> wrote:
> Hello,
>
> I've added a destroy handler to multiuser.adb test program:
>
>
>
> But I've got the following error with GNAT GPL 2016:
>
> gprbuild -ws -c -f -u -P/gnoga-code/test/test.gpr
> -XLIB_COMPONENTS_BUILD=default -XPRJ_TARGET=OSX -XPRJ_BUILD=Debug
> multiuser.adb
> gcc -c -gnaty3abcefhiklM120nOprsStu -gnat2012 -gnatW8 -g -gnata -gnatq
> -gnatQ -gnatw.eH.YD -gnatVa -gnato -fstack-check -gnatf -gnateE -gnateF
> -gnatec=/gnoga-code/pragma_debug.adc -fno-common multiuser.adb
> multiuser.adb:64:07: warning: "App" is not modified, could be declared
> constant
> multiuser.adb:81:07: warning: "App" is not modified, could be declared
> constant
> multiuser.adb:94:07: warning: "App" is not modified, could be declared
> constant
> multiuser.adb:103:07: warning: "App" is not modified, could be declared
> constant
> multiuser.adb:109:07: warning: variable "App" is not referenced
> multiuser.adb:119:07: warning: "App" is not modified, could be declared
> constant
> multiuser.adb:193:43: no candidate interpretations match the actuals:
> multiuser.adb:193:43: missing argument for parameter "Object" in call to
> "On_Destroy" declared at line 115
> multiuser.adb:193:43: missing argument for parameter "Object" in call to
> "On_Destroy" (inherited) at gnoga-gui-element.ads:51
> multiuser.adb:193:43: context requires function call, found procedure name
> multiuser.adb:193:53: ==> in call to inherited operation
> "On_Destroy_Handler" at gnoga-gui-window.ads:56
> multiuser.adb:218:07: warning: "D" modified by call, but value never
> referenced
> gprbuild: *** compilation phase failed
> [2017-05-14 10:21:43] process exited with status 4, elapsed time: 00.69s
>
> If I change ligne 193 to:
>
> App.Main_Window.On_Destroy_Handler (Multiuser.On_Destroy'
> Unrestricted_Access);
>
> No more errors.
>
> Why these errors not so much clear are issued?
> Why local procedure On_Destroy isn't visible?
>
> Thanks, Pascal.
> http://blady.pagesperso-orange.fr
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gnoga-list mailing list
> Gnoga-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gnoga-list
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list