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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b5c82fc60f790fde X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-05 16:32:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!iad-peer.news.verio.net!news.verio.net!newsfeed.vmunix.org!news-mue1.dfn.de!news-fra1.dfn.de!news.tele.dk!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Return value that is an access to array element References: From: Andreas Almroth Date: 06 Aug 2002 01:32:20 +0200 Message-ID: <87wur46fwb.fsf@almroth.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: TDC Internet NNTP-Posting-Host: 131.164.233.79 X-Trace: 1028590340 dread06.news.tele.dk 78178 131.164.233.79 X-Complaints-To: abuse@post.tele.dk Xref: archiver1.google.com comp.lang.ada:27734 Date: 2002-08-06T01:32:20+02:00 List-Id: "Martin Dowie" writes: > Given the following code, should a compiler raise an error given > LM 3.10.2 (25) as an error or not? > > generic > type T is private; > type TA is access all T; > package Foo is > type XT is private; > function Get (X : XT) return TA; > private > type AT is array (Positive range <>) of aliased T; > type AA is access AT; > type XT is record > A : AA; > end record; > end Foo; > > package body Foo is > function Get (X : XT) return TA is > begin > return X.A (1)'Access; -- Error here? > end Get; > end Foo; ? GNAT 3.14p sure gives an error saying you can't use AT as an type, as it is a reserved word. Compiles just fine when changes to something else... My $0.25, Andreas