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.81.202 with SMTP id c10mr2596995pay.40.1349462677024; Fri, 05 Oct 2012 11:44:37 -0700 (PDT) Received: by 10.68.216.132 with SMTP id oq4mr3468417pbc.8.1349462677008; Fri, 05 Oct 2012 11:44:37 -0700 (PDT) Path: g9ni23679pbh.1!nntp.google.com!kr7no5971089pbb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 5 Oct 2012 11:44:36 -0700 (PDT) In-Reply-To: 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2299402b-d975-4ea6-8794-2657f4b722ad@googlegroups.com> Subject: Re: Odd subtyping error. From: Adam Beneschan Injection-Date: Fri, 05 Oct 2012 18:44:37 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-10-05T11:44:36-07:00 List-Id: On Friday, October 5, 2012 11:12:18 AM UTC-7, Niklas Holsti wrote: > On 12-10-05 19:05 , Shark8 wrote: >=20 > > I'm making a new OpenGL binding taking advantage of Ada 2012 and have c= ome across several interesting errors, including a compiler-bug... but this= one is by far the oddest: >=20 > > Type Pixel_Storage is ( > > UNPACK_SWAP_BYTES, UNPACK_LSB_FIRST, UNPACK_ROW_LENGTH, =09 > > UNPACK_SKIP_ROWS, UNPACK_SKIP_PIXELS, UNPACK_ALIGNMENT, > > PACK_SWAP_BYTES, PACK_LSB_FIRST, PACK_ROW_LENGTH, > > PACK_SKIP_ROWS, PACK_SKIP_PIXELS, PACK_ALIGNMENT, > > PACK_SKIP_IMAGES, PACK_IMAGE_HEIGHT, UNPACK_SKIP_IMAGES, > > UNPACK_IMAGE_HEIGHT > > ) with Size =3D> Enum'Size; > >=20 >=20 > > SubType Pixel_Packing is Pixel_Storage Range PACK_SWAP_BYTES..PACK_= IMAGE_HEIGHT; >=20 > > Unless I'm just completely misunderstanding the above should be perfect= ly fine, yet it generates a few errors: >=20 > > warning: no more representation items for type "Pixel_Storage" defined= at line 625 > > representation item appears too late [private section representation-c= lause] >=20 > It would be easier to answer you if you showed a complete, minimal > example (i.e. an .ads file) where you have removed the irrelevant parts. >=20 > The second error/warning line suggests to me that you have declared > Pixel_Storage first as a "private" type, and that the full type > declaration, including the "with Size" clause, appears only in the > "private" part of the package declaration. Is that the case? I agree that a more complete example would be helpful. However, I can't im= agine how the fact that it's declared as private could make a difference. = A private type's full declaration must occur before the type is frozen, so = if something occurred earlier that would freeze the type, he would have got= ten error messages at that point. The error message he's getting seems to = imply that the compiler already thinks the type is frozen by the time it se= es the aspect clause, which is impossible; or, if it's displaying the error= when it sees the subtype declaration, then it's just plain lost its head. -- Adam