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: a07f3367d7,13aaae984988cb0d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!x6g2000prc.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Discriminant and type extensions Date: Mon, 5 Oct 2009 16:08:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0d9da8c4-ab17-42b0-99ea-09ecf02435e5@x6g2000prc.googlegroups.com> References: <2b205c63-55e7-4cef-95d2-5b0ece0b8866@p9g2000vbl.googlegroups.com> <42a46538-2430-4738-9cb4-7cbbb0c7db33@b25g2000prb.googlegroups.com> <13d2a00f-4774-4860-95fa-5228389259b1@f10g2000vbf.googlegroups.com> <220c069a-a09c-413f-811c-d3b00e1b6d7e@o13g2000vbl.googlegroups.com> 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 1254784103 16209 127.0.0.1 (5 Oct 2009 23:08:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 5 Oct 2009 23:08:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x6g2000prc.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),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8593 Date: 2009-10-05T16:08:23-07:00 List-Id: On Oct 5, 3:34=A0pm, Yannick Duch=EAne Hibou57 wrote: > Re- Not legal, the compiler don't want this Referring to the example where you removed the genericity: If you put this on *both* the private and full declarations of Extension_Type: type Extension_Type (Discriminant : Natural) is new P1.T_Type (Discriminant =3D> Discriminant) then take the (Discriminant =3D> Discriminant) off the *private* extension declaration. I.e.: type Extension_Type (Discriminant : Natural) is new P1.T_Type with private; But leave it on the full declaration: type Extension_Type (Discriminant : Natural) is new P1.T_Type (Discriminant =3D> Discriminant) with null record; See if that works. The reason has to do with a rule about statically matching constraints. See AARM 7.3(13.e), at http://www.adaic.org/standards/05aarm/= html/AA-7-3.html -- look for paragraph 13.e. -- Adam