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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9fb18b5057796461 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-25 01:12:04 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor-online.net!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Procedure Overloading Date: Fri, 25 Jul 2003 09:57:23 +0200 Message-ID: References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1059119582 18269461 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:40797 Date: 2003-07-25T09:57:23+02:00 List-Id: On Thu, 24 Jul 2003 20:49:45 GMT, "Justin Schaub" wrote: >Is there a way to specify which overloaded procedure is called in the >following example? > >package A > >type Access_Integer is access Integer; > >procedure compute( Num : access Integer); >procedure compute(Num : Access_Integer); > >end A; > >procedure Test is > B : Access_Integer; >begin > compute(B); >end Test; > >The GNAT compiler allows compilation of the package A, but when compiling >the procedure B it says that there is an ambiguous reference to the >overloaded compute function. > >I have heard that you could simply do > >compute (Access_Integer'(B)); > >but that didn't work either. Any ideas? I know it's a silly example but we >are importing the ADA GLU bindings that have a similar issue. Passing integers by pointers plus clashed types is indeed silly. You can rename compute: procedure Test is procedure compute_with_anonymous (Num : access Integer) renames A.compute; procedure compute_with_named (Num : Access_Integer) renames A.compute; B : Access_Integer; begin compute_with_named (B); end Test; --- Regards, Dmitry Kazakov www.dmitry-kazakov.de