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,6d748e86b56b1269 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-27 11:35:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!news.litech.org!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!wanadoo.fr!freenix!enst.fr!not-for-mail From: Vadim Godunko Newsgroups: comp.lang.ada Subject: Re: Prefix to 'ACCESS must either statically match... But why? Date: Mon, 27 Jan 2003 22:30:25 +0300 Organization: ENST, France Message-ID: References: <5ad0dd8a.0301251431.6370c6bc@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=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1043696104 38582 137.194.161.2 (27 Jan 2003 19:35:04 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 27 Jan 2003 19:35:04 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020605 X-Accept-Language: en-us, en 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:33464 Date: 2003-01-27T22:30:25+03:00 Wojtek Narczynski wrote: > > Could somebody please explain me why is this rule present? I find it > very limting. Is this because AR2 bounds are not stored with the > object? > > Type Stream_Element_Array_access is access all Stream_Element_Array; > RM 3.3.1(8): The _subtype_indication_ or full type definition of an _object_declaration_ defines the nominal subtype of the object. The _object_declaration_ declares an object of the type of the nominal subtype. > AR1 : aliased Stream_Element_Array := ( 2, 4, 5 ); AR1 nominal subtype is Stream_Element_Array (<>) of type Stream_Element_Array (<>) > AR2 : aliased Stream_Element_Array ( 1 .. 3 ) := ( 2, 4, 5 ); AR2 nominal subtype is Stream_Element_Array (1 .. 3) of type Stream_Element_Array (<>) > > AR1A : Stream_Element_Array_access := AR1'access; > > -- Illegal > AR2A : Stream_Element_Array_access := AR2'access; > > RM/TC1 3.10.2 (24): ... The view denoted by the prefix X shall satisfy the following additional requirements, presuming the expected type for the X'Access is the general access type A with designated type D: RM/TC1 3.10.2 (27/1): ...; if D is untagged, then the type view shall be D, and A's designated subtype either statically match the nominal subtype of the view or be discriminanted and unconstrained. A = Stream_Element_Array_Access D = Stream_Element_Array (<>) D - untagged; type of both view is Stream_Element_Array (<>) = D; and A's designated subtype (Stream_Element_Array (<>)) is discriminanted and unconstrained. What's wrong? Vadim Godunko