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,98e3ee7e73b9dd89 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Aliased References: <1118851601.345326.86640@g49g2000cwa.googlegroups.com> <1118930589.514028.150340@g47g2000cwa.googlegroups.com> In-Reply-To: <1118930589.514028.150340@g47g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 17 Jun 2005 02:15:04 GMT NNTP-Posting-Host: 4.240.241.147 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1118974504 4.240.241.147 (Thu, 16 Jun 2005 19:15:04 PDT) NNTP-Posting-Date: Thu, 16 Jun 2005 19:15:04 PDT Xref: g2news1.google.com comp.lang.ada:11438 Date: 2005-06-17T02:15:04+00:00 List-Id: nblanpain@hotmail.com wrote: > > ------ Container.ads > generic > type T_Item is private; > Static_Size : Integer; > package Container is > type T_Array is array (Integer range <>) of T_Item; > type A_Array is access all T_Array; > type T_Container is tagged record > Obj_Array : aliased T_Array (1..Static_Size); > Ptr_Array : A_Array; > end record; > This.Ptr_Array := This.Obj_Array'Access; --- Compilation Error > > -- Compilation Error : Object subtype must statically match designated > subtype. No local pointer cannot point to local object. A_Array designates an unconstrained array type, T_Array. This.Obj_Array is a component of a constrained subtype of T_Array. This.Obj_Array'access does not designate the same subtype as A_Array. That's why this is illegal. Change your type declaration to type T_Array is array (1 .. Static_Size) of T_Item; and this should work. -- Jeff Carter "I blow my nose on you." Monty Python & the Holy Grail 03