From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,2ea6ccd50b440aa7 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Problem when overloading a procedure Date: 1999/08/14 Message-ID: #1/1 X-Deja-AN: 512823925 Content-Transfer-Encoding: 8bit References: Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: typ11.nn.bcandid.com 934661802 216.180.14.178 (Sat, 14 Aug 1999 16:16:42 EDT) MIME-Version: 1.0 NNTP-Posting-Date: Sat, 14 Aug 1999 16:16:42 EDT Newsgroups: comp.lang.ada Date: 1999-08-14T00:00:00+00:00 List-Id: JIMHER@yanoesladirecci�n.com wrote in message news:MPG.121fca311abf8d5b98999b@news.bcn.ttd.net... > I'm writing a program, and I have found a problem when I try to overload > a procedure. The program is: > > procedure program is > > type MyType is array(1..10) of character; > > procedure proc(s:in string) is > begin > put_line("Original string"); > end proc; > > procedure proc(s:in MyType) is > begin > put_line("My type"); > end proc; > > begin > proc("hello"); > end program; > > The problem is that, when I compile the program, the compiler says that > is unable to select between the two forms of 'proc'. I suppose that it is > because the compiler can't decide if the literal "hello" is of type > string or MyType, so I tried > > ... > begin > proc(string("hello")); > end program; > > but the compiler didn't accept it. > Your analysis was correct, and your solution was almost correct. it should have been proc(string'("hello")); See RM 4.7