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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9dcaa9f073e2ef8f,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!o10g2000prn.googlegroups.com!not-for-mail From: Adrian Hoe Newsgroups: comp.lang.ada Subject: Type in allocator has deeper level than designated class-wide type Date: Mon, 13 Jun 2011 08:31:43 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9bf2ef73-5cc7-4863-90d7-2e2cf3bcd294@o10g2000prn.googlegroups.com> NNTP-Posting-Host: 110.159.15.203 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1307979103 18553 127.0.0.1 (13 Jun 2011 15:31:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 13 Jun 2011 15:31:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o10g2000prn.googlegroups.com; posting-host=110.159.15.203; posting-account=coq9PAkAAAB2Xx46RZLFJw5dY9DVXW4- User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUARLECNK X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:20763 Date: 2011-06-13T08:31:43-07:00 List-Id: Hi all, I have stomped into above error and I am stuck with the error and runtime exception PROGRAM_ERROR : accessibility check failed. Here's the fragment of my codes: generic N : Positive; type Item is private; package High_Cloud is package List renames Heterogeneous_Doubly_Link_List; use List; type Data_Array is array ( 1 .. N ) of Item; type Element_Record is new List.Node with private; type Series_Access is new List.Access_List; private type Element_Record is new List.Node with record Name : Unbounded_String; Color : Unbounded_String; Data : Data_Array; end record; ... end High_Cloud; In the package body of High_Cloud, I have a procedure: procedure Add ( Cloud : in out High_Cloud_Record; Name : in Unbounded_String; Color : in Unbounded_String; Data : in Data_Array ) is New_Element : List.Access_Node; begin New_Element := new Element_Record' <========== Error/Warning here. ( Constructor.Init ( Name, Color, Data) ) ; Concatenate ( Cloud.Series, New_Element ) ; end Add; My intention is to use genericity to create a data which is an array (1..N) of any_type. This data is then stored in a list. Procedure Add instantiate (by calling to Constructor.Init) the list's node with data. I have read the ARM 3.10.2 and 3.10.1 and also John Barnes book yet I still have no clue how to solve the problem. Can you please help? Thanks. -- Adrian Hoe http://adrianhoe.com/adrianhoe