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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8c424d8135e68278 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-20 07:06:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!newsfeed.mathworks.com!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news11-gui.server.ntli.net.POSTED!not-for-mail Sender: mjw@golux Newsgroups: comp.lang.ada Subject: Re: Ada2005 References: <9v4jsj$bd1$1@infosun2.rus.uni-stuttgart.de> <9v7f26$qn2$1@infosun2.rus.uni-stuttgart.de> <3C1754BA.C4560423@informatik.uni-jena.de> <3C21CA5D.4311D521@informatik.uni-jena.de> From: Matthew Woodcraft Message-ID: <877krilyuy.fsf@chiark.greenend.org.uk> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 20 Dec 2001 15:01:25 +0000 NNTP-Posting-Host: 213.107.104.73 X-Complaints-To: abuse@ntlworld.com X-Trace: news11-gui.server.ntli.net 1008860493 213.107.104.73 (Thu, 20 Dec 2001 15:01:33 GMT) NNTP-Posting-Date: Thu, 20 Dec 2001 15:01:33 GMT Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:18148 Date: 2001-12-20T15:01:25+00:00 List-Id: Carsten Freining writes: > As an example I asked a couple of months ago the following thing. > > I have an access-type to integer lets say > > Type IntAccessType is access integer; > IntAccess: IntAccessType; > > Subtype IntSubType is integer Range 0..25; > > begin > IntAccess := new IntSubType'(15); > IntAccess.all := 33; > end; [and was surprised that this compiles and runs without error] It seems to me there is a good question here: why is the allocator allowed to compile? Is there ever a case where you want to allocate an object using a different subtype to the one specified in the access type? Seems to me this would only cause confusion for the maintainer. What problems would be caused if 4.8 para 3 were modified like this? 3. The expected type for an allocator shall be a single - access-to-object type whose designated type covers the type - determined by the subtype_mark of the subtype_indication or + access-to-object type whose designated subtype statically + matches the subtype_mark of the subtype_indication or qualified_expression. At the least, a warning in this case might have reduced the poster's confusion. -M-