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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,12d893e9461dcfe6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.138.146 with SMTP id a18mr5895628qau.6.1344263604260; Mon, 06 Aug 2012 07:33:24 -0700 (PDT) Received: by 10.216.233.196 with SMTP id p46mr570141weq.0.1344263490681; Mon, 06 Aug 2012 07:31:30 -0700 (PDT) Path: c6ni60393021qas.0!nntp.google.com!r1no8150955qas.0!news-out.google.com!q11ni72442439wiw.1!nntp.google.com!feed-C.news.volia.net!volia.net!news2.volia.net!feed-A.news.volia.net!npeer.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.panservice.it!newsfeed.tele2net.at!news.mixmin.net!feed.xsnews.nl!border-1.ams.xsnews.nl!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 31 Jul 2012 09:48:04 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Access to generic formal parameters in an generic package instantiation References: <87a9yi5t7j.fsf@mid.deneb.enyo.de> In-Reply-To: <87a9yi5t7j.fsf@mid.deneb.enyo.de> Message-ID: <50178db2$0$6562$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 31 Jul 2012 09:48:02 CEST NNTP-Posting-Host: 54d0d9bf.newsspool4.arcor-online.net X-Trace: DXC=HKLBgS3WocRYQ5E:l_dSPCY\c7>ejVXTYWkQ3a8iF_7NTm3@g]51X X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-07-31T09:48:02+02:00 List-Id: On 29.07.12 20:16, Florian Weimer wrote: > It seems that generic formal packages are unusual because GNAT shows > some strange effects (and the occasional bug box). Compilers seem to differ on this one, which should be Ada 95. I am not sure the generics are properly addressing the issue of type comparison (well, of convertibility). With GNAT's bug boxes currently in the way I can't try the Ada 2012 features. (Something about failures when testing entity node kinds.) generic type T is private; Fst, Snd : in T; package Same_Type is end; with Same_Type; generic type Ancestor is private ; type T1 is new Ancestor; type T2 is new Ancestor; X : T1; Y : T2; -- with package Comparison is new Same_Type (T1, T1'(X), T1 (Y)); package Ops is private package Comparison_1 is new Same_Type (T1, T1'(X), T1 (Y)); package Comparison_2 is new Same_Type (T2, T2 (X), T2'(Y)); end; with Same_Type, Ops; procedure Test_G is type Int is new Integer; type Chr is new Character; Two : constant Int := 2; C : constant Chr := 'c'; package Test_1 is new Ops (Int, Int, Int, Two, Two); --!GNAT! package Test_2 is new Ops (Int, Int, Chr, Two, C); package PK is type root is tagged null record; type left is new root with null record; type right is new root with null record; end PK; use pK; L : Left; R : Right; package test_3 is new ops (Root, Left, Right, L, R); begin null; end Test_G;