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-29 04:22:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: "Grein, Christoph" Newsgroups: comp.lang.ada Subject: Re: Prefix to 'ACCESS must either statically match... But why? Date: Wed, 29 Jan 2003 13:15:27 +0100 (MET) Organization: ENST, France Message-ID: Reply-To: "Grein, Christoph" , "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: avanie.enst.fr 1043842974 45136 137.194.161.2 (29 Jan 2003 12:22:54 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 29 Jan 2003 12:22:54 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Authentication-Warning: mail.eurocopter.com: uucp set sender to using -f Content-MD5: 3iI8AXcfpwMlOrk/cKLElg== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc 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:33551 Date: 2003-01-29T13:15:27+01:00 > 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? This is my exegesis. I admit, the whole theme is quite obscure... AR1 nominal subtype Stream_Element_Array, constrained by initial value to actual subtype Stream_Element_Array (1 .. 3). AR2 nominal and actual subtype Stream_Element_Array (1 .. 3). So for AR1, nominal subtypes statically match, for AR2, they don't. It's the nominal subtypes that have to match, not the actual ones. See RM 3.3.1(8,9), 3.10(10), 3.10.2(27/1), 4.9.1(2). Gnat 3.16w seems to have a problem here.