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,799bdb14b530ce1d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.88.231 with SMTP id bj7mr2705219pab.45.1349475066177; Fri, 05 Oct 2012 15:11:06 -0700 (PDT) Received: by 10.68.134.129 with SMTP id pk1mr3585363pbb.13.1349475066159; Fri, 05 Oct 2012 15:11:06 -0700 (PDT) Path: t10ni23613332pbh.0!nntp.google.com!kt20no11349393pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 5 Oct 2012 15:11:05 -0700 (PDT) In-Reply-To: <5e6b8e61-50c5-4398-9407-60276a070f4f@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <99b6ed38-0a44-4649-82b7-0b724fa5e68f@googlegroups.com> <5e6b8e61-50c5-4398-9407-60276a070f4f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Odd subtyping error. From: Adam Beneschan Injection-Date: Fri, 05 Oct 2012 22:11:06 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-10-05T15:11:05-07:00 List-Id: On Friday, October 5, 2012 2:00:53 PM UTC-7, Shark8 wrote: > Package Subtype_Error is >=20 > Type Base_Type is ( > Item_1, Item_2, Item_3, Item_4, Item_5 > ) with Size =3D> Integer'Size; >=20 > SubType Derived_Type is Base_Type Range Item_2..Item_4; > Private > For Base_Type Use > ( > Item_1 =3D> 18, > Item_2 =3D> 21, > Item_3 =3D> 22, > Item_4 =3D> 25, > Item_5 =3D> 28 > ); > End Subtype_Error; Ah, "the rest of the story"! The size clause isn't the problem. The probl= em is that referring to Item_2 and Item_4 in the declaration of Derived_Typ= e freezes Base_Type, and you can't add any more representation information = after that. That makes "For Base_Type Use ..." illegal. If the error mess= ages in your original case pointed you to the wrong line numbers, that's so= mething you can complain to the GNAT folks about. But the error is legitim= ate, at least in your reduced source. -- Adam