comp.lang.ada
 help / color / mirror / Atom feed
* Unclear error message - please help
@ 2005-09-17 21:11 Alfred Hilscher
  2005-09-17 21:44 ` Gene
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Alfred Hilscher @ 2005-09-17 21:11 UTC (permalink / raw)


Hello,

I have a problem with some code I've written. The compiler (GNAT 3.15p
on Windows) reports an error whereas I think it should not.


Package spec:

package Pkg is
  procedure Proc (Host : STRING; RC : out Integer; Identifier : in
Integer := 0);

  procedure Proc (Host : STRING;
                 Time_Response : out Integer; RC : out Integer;
                 Time_Wait : Integer := 1000;
                 Identifier : Integer := 0);
end Pkg;


Main program:

with Text_IO;
with Ada.Command_Line;  use Ada.Command_Line;

with Pkg; use Pkg;

procedure PkgTest is
  RC : Integer;
begin
  if Argument_Count /= 1
  then
    Text_IO.Put_Line ("call: PkgTest <ip>");
    return;
  end if;
  
  Proc (Argument (1), RC, 2507);
  Text_IO.Put_Line ("RC=" & Integer'Image (RC));
end PkgTest;


The compiler says, that the procedure call is ambigous, but I think, it
is clear, that "Proc" from line 2 should be used, as it has parameters
(in, out, in) while "Proc" from line 4 has (in, out, out). And the value
(2507) in the call of "Proc" can not be used as an "out" parameter. It
this a know error, or do I have strong misunderstandings there?

pkgtest.adb:15:03: ambiguous expression (cannot resolve "Proc")
pkgtest.adb:15:03: possible interpretation at pkg.ads:4
pkgtest.adb:15:03: possible interpretation at pkg.ads:2

-- 
-----------------------------------------------------
To send me mail, please replace "Spam" by "Jedermann"
-----------------------------------------------------



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

end of thread, other threads:[~2005-10-16  1:10 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-17 21:11 Unclear error message - please help Alfred Hilscher
2005-09-17 21:44 ` Gene
2005-09-17 22:02 ` Ludovic Brenta
2005-09-18  2:32 ` Robert A Duff
2005-10-08 19:39   ` Alfred Hilscher
2005-10-08 20:15     ` Björn Persson
2005-10-09  7:34       ` Martin Krischik
2005-10-08 21:28     ` Dmitry A. Kazakov
2005-10-08 23:58     ` Robert A Duff
2005-10-09  7:29     ` Martin Krischik
2005-10-09 14:24       ` Robert A Duff
2005-10-09 22:02       ` Brian May
2005-10-10 16:49         ` Martin Krischik
2005-10-10 22:20           ` Brian May
2005-10-11  5:48             ` Martin Dowie
2005-10-11 18:03             ` Martin Krischik
     [not found]         ` <h84lk1tqgofrhgabm8q3sqbb80li6733bh@4ax.com>
2005-10-16  1:10           ` 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