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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38b27bed88e97415 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-20 05:23:50 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!freenix!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Question: Combination of Access and Constraining Date: Thu, 20 Feb 2003 07:12:10 -0600 Organization: ENST, France Message-ID: References: <1d13e1b4.0302200006.70207b86@posting.google.com> Reply-To: "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1045746647 10832 137.194.161.2 (20 Feb 2003 13:10:47 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Thu, 20 Feb 2003 13:10:47 +0000 (UTC) To: "comp.lang.ada mail to news gateway" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:34271 Date: 2003-02-20T07:12:10-06:00 TpCon needs to be a subtype of Tp -- i.e.: subtype TpCon is Tp (1 .. 1); Now, your function call will work. However, there's no need to define a subtype explicitly. Why not just say Arr: aliased Tp (1 .. 1); ----- Original Message ----- From: "Papandopulo" Newsgroups: comp.lang.ada To: Sent: February 20, 2003 2:06 AM Subject: Question: Combination of Access and Constraining > 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 > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada > >