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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,79d6bba6ba97b840,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!a19g2000yql.googlegroups.com!not-for-mail From: Gene Newsgroups: comp.lang.ada Subject: Renaming of procedures in a generic instantiation Date: Sat, 25 Sep 2010 17:43:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 184.12.81.69 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1285461797 23632 127.0.0.1 (26 Sep 2010 00:43:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 26 Sep 2010 00:43:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a19g2000yql.googlegroups.com; posting-host=184.12.81.69; posting-account=-BkjswoAAACC3NU8b6V8c50JQ2JBOs04 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPNTDF; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14258 Date: 2010-09-25T17:43:17-07:00 List-Id: I'm confused about an aspect of renaming. It boils out to this little example: with Ada.Containers.Ordered_Sets; package Foo is type Queue is private; procedure Add(Q : in out Queue; Item : in Integer); function Is_Empty(Q : Queue) return Boolean; private package Queues is new Ada.Containers.Ordered_Sets(Integer, "<", "="); type Queue is new Queues.Set with null record; end Foo; package body Foo is procedure Add(Q : in out Queue; Item : in Integer) renames Insert; function Is_Empty(Q : Queue) return Boolean renames Queues.Is_Empty; end Foo; The renaming in Add "finds" the correct procedure Insert, but the renaming of Is_Empty fails: gnatmake foo.adb gcc -c foo.adb foo.adb:6:04: no visible subprogram matches the specification for "Is_Empty" foo.adb:6:13: expected private type "Ada.Containers.Ordered_Sets.Set" from insta nce at foo.ads:14 foo.adb:6:13: found type "Queue" defined at foo.ads:16 gnatmake: "foo.adb" compilation error I guess I can see this error because a parameter type conversion is implied in the renaming. But then why does the renaming of Insert work correctly? Running Win7 64 bit with: gcc (GCC) 4.3.4 20090511 for GNAT GPL 2009 (20090511) Thanks.