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!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-stuttgart.de!carbon.eu.sun.com!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: Aliased Date: Wed, 15 Jun 2005 16:35:17 +0000 (UTC) Organization: BT Openworld Message-ID: References: <1118851601.345326.86640@g49g2000cwa.googlegroups.com> NNTP-Posting-Host: host81-154-188-69.range81-154.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com 1118853317 19420 81.154.188.69 (15 Jun 2005 16:35:17 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Wed, 15 Jun 2005 16:35:17 +0000 (UTC) In-Reply-To: <1118851601.345326.86640@g49g2000cwa.googlegroups.com> X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) Xref: g2news1.google.com comp.lang.ada:11388 Date: 2005-06-15T16:35:17+00:00 List-Id: nblanpain@hotmail.com wrote: > Hello, > > I have a probleme with aliased variable : > > -- Specification > > package Test is > > ... > > private > > type T_Toto is ...; > type A_Toto is acess all T_Toto; > > type T_Test is new T_Object with record > Tab : aliased T_Toto; > Ptr_Tab : A_Toto; > end record; > > end Test; > > -- Body > > package body Test is > > ... > > procedure Initialize is > begin > Ptr_Tab := Tab'Access; -- illegal instruction > end Initialize; > > ... > > end Test; > > Where is the problem and is there a solution to it? Tab is a component of a record type "T_Test" but you have not provided a data object of such a type. On the assumption that you are creating a "singleton" data object of type "T_Test" within the package body of "Test", you need something like: package body Test is My_Test_Data : T_Test; procedure Initialise is begin My_Test_Data.Ptr_Tab := My_Test_Data.Tab'Access; end Initialise; end Test; Cheers -- Martin