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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38b27bed88e97415,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-20 00:06:15 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: papand0pul0@yahoo.com (Papandopulo) Newsgroups: comp.lang.ada Subject: Question: Combination of Access and Constraining Date: 20 Feb 2003 00:06:15 -0800 Organization: http://groups.google.com/ Message-ID: <1d13e1b4.0302200006.70207b86@posting.google.com> NNTP-Posting-Host: 63.215.236.155 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1045728375 3139 127.0.0.1 (20 Feb 2003 08:06:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 20 Feb 2003 08:06:15 GMT Xref: archiver1.google.com comp.lang.ada:34254 Date: 2003-02-20T08:06:15+00:00 List-Id: Small Ada question: I need one function to accept an array of unknown size of Boolean, so I declare type and function: type Tp is array (Positive range <>) of Boolean; type Tp_Access is access all Tp; function Fn (Arg : in Tp_Access) return Natural; Now I try to call it with the constrained array: declare type TpCon is new Tp(1..1); Arr : aliased TpCon; begin Arr(1) := True; Res := Fn (Arr'Access); end; Compiler says on the invocation line: expected type: Tp_Access defined at ... found type TpCon defined at ... I think that access to constrained type should be convertible to access to unconstrained type. So where I am going wrong here ? Thanx, George