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-Thread: 103376,4cd601a04ec3f19e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!8g2000prt.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: formal package question Date: Mon, 14 Feb 2011 07:38:51 -0800 (PST) Organization: http://groups.google.com Message-ID: <8d80291a-0c0d-4b66-9a30-5f8607d0234b@8g2000prt.googlegroups.com> References: <4d58fd11$0$6770$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1297697963 17226 127.0.0.1 (14 Feb 2011 15:39:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 14 Feb 2011 15:39:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 8g2000prt.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17278 Date: 2011-02-14T07:38:51-08:00 List-Id: On Feb 14, 1:59=A0am, Georg Bauhaus wrote: > On 14.02.11 03:46, ytomino wrote: > > > > > > > Hello, > > Please look this code: > > > -------- > > package formalpkg is > > > =A0 =A0generic > > =A0 =A0 =A0 type T is private; > > =A0 =A0 =A0 with procedure P (X : T) is <>; > > =A0 =A0package F is > > =A0 =A0end F; > > > =A0 =A0generic > > =A0 =A0 =A0 with package FA is new F (others =3D> <>); > > =A0 =A0package B is > > =A0 =A0end B; > > > =A0 =A0procedure P1 (X : Character) is null; > > =A0 =A0package F1 is new F (Character, P1); -- use P =3D> P1 > > > =A0 =A0package B1 is new B (F1); -- Error !! > > > =A0 =A0procedure P (X : Character) is null; > > =A0 =A0package F2 is new F (Character); -- P =3D> P > > > =A0 =A0package B2 is new B (F2); -- OK > > > end formalpkg; > > -------- > > % gnatmake formalpkg.ads > > gcc -c formalpkg.ads > > formalpkg.ads:17:25: actual for "P" in actual instance does not match > > formal > > gnatmake: "formalpkg.ads" compilation error > > -------- > > > B1 was compile error, but B2 is ok. Why? > > I get an error for B2, probably using a different GNAT. > Not really an answer, but can you leave out the "others" > in ([others =3D>] <>) ? Yes, it compiles for me if I say F(<>) but gets an error with F(others =3D> <>). There should be no difference between the two syntaxes, so this is an error in the compiler. -- Adam