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,162ee844b6e6caa1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.wirehub.nl!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder2.news.jippii.net!reader1.news.jippii.net!53ab2750!not-for-mail Message-ID: <416ED0D2.706@nowhere.fi> From: Niklas Holsti Organization: Tidorum Ltd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Odd error with access to derived types References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 14 Oct 2004 22:17:38 +0300 NNTP-Posting-Host: 194.29.197.8 X-Complaints-To: newsmaster@saunalahti.com X-Trace: reader1.news.jippii.net 1097781459 194.29.197.8 (Thu, 14 Oct 2004 22:17:39 EEST) NNTP-Posting-Date: Thu, 14 Oct 2004 22:17:39 EEST Xref: g2news1.google.com comp.lang.ada:5217 Date: 2004-10-14T22:17:38+03:00 List-Id: A. Imran wrote: > Hello, > > I'm getting a very odd error from my compiler (GNAT 3.15p, also tried > the latest GCC based GNAT). > > Would anyone point out why the following is / is not valid ada? TIA. The following works for me with GNAT 3.15p, Debian: package testp is type a_type is tagged record foo : natural; end record; end testp; package testp.b is type b_type is new a_type with private; type b_access is access all b_type; private type b_type is new a_type with record dummy : boolean; end record; end testp.b; Did I misunderstand which variant of your code fails? Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ . > > -- begin testp-b.adb -- > package testp.b is > > -- TO FAIL: Comment the next line and leave > -- the line after that uncommented. > > -- XXX 0 > -- type b_type is new a_type with null record; > type b_type is new a_type with private; > > type b_access is access all b_type; > > private > > -- TO FAIL: Keep the following uncommented > -- XXX 1 > type b_type is new a_type with record > dummy : boolean; > end record; > > end testp.b; > -- end testp-b.adb -- > > I'm getting an error that says that the definition of the private type > (XXX 1) conflicts with the access type (XXX 0). Any ideas? > > > > Here is the rest of the code: > > -- begin testp.adb -- > package testp is > > task type a_task; > > type a_type is abstract tagged limited record > dummy_task : a_task; > end record; > > end testp; > -- end testp.adb -- > > -- begin test.adb -- > -- Just used for compiling library units > with testp; > with testp.b; > > procedure test is > begin > null; > end test; > -- end test.adb -- > >