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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.128.112 with SMTP id e76mr1530635yhi.38.1397591066831; Tue, 15 Apr 2014 12:44:26 -0700 (PDT) X-Received: by 10.50.78.234 with SMTP id e10mr2313igx.17.1397591066629; Tue, 15 Apr 2014 12:44:26 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!cm18no3249210qab.0!news-out.google.com!gi6ni469igc.0!nntp.google.com!ur14no8640868igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 15 Apr 2014 12:44:25 -0700 (PDT) In-Reply-To: <1ffb84f0-5e50-4807-90ff-dfdfac11c501@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <1ffb84f0-5e50-4807-90ff-dfdfac11c501@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <596f076f-919e-4cd2-bb2e-ad0134e0d5c3@googlegroups.com> Subject: Re: Problem with generic package From: Adam Beneschan Injection-Date: Tue, 15 Apr 2014 19:44:26 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:19313 Date: 2014-04-15T12:44:25-07:00 List-Id: Sorry, I was a bit hasty with my previous response. I was looking just at = the code you posted here, which wasn't complete information. On looking at= the code at your github site, I think I see what's going on. The problem is that in this line: procedure Exchange is new Swap_Generic (Value_Type =3D> Element_Type); since you have a Swap_Generic in the same package body, the compiler thinks= that's what the name Swap_Generic refers to. But it looks like you also h= ave a top-level generic procedure Swap_Generic. I assume that's what the a= bove line was trying to instantiate. First of all, you need to put "with Swap_Generic;" at the top of Array_Gene= rics.adb; otherwise the top-level generic procedure can never be used.=20 Then, since the name of the other non-generic Swap_Generic hides the one yo= u've WITH'ed, you need to say this in order to instantiate the generic Swap= _Generic: procedure Exchange is new=20 Standard.Swap_Generic (Value_Type =3D> Element_Type); since all top-level units are children of Standard. The compiler cannot us= e "overload resolution" to find the correct Swap_Generic because generics c= annot be overloaded with anything. -- Adam