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-Thread: 103376,ea5071f634c2ea8b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.35.68 with SMTP id f4mr4609057pbj.5.1322060715252; Wed, 23 Nov 2011 07:05:15 -0800 (PST) Path: lh20ni9386pbb.0!nntp.google.com!news2.google.com!newsfeed2.dallas1.level3.net!newsfeed3.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Generic-Package Elaboration Question / Possible GNAT Bug. Date: Wed, 23 Nov 2011 10:05:14 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <7bf9bc32-850a-40c6-9ae2-5254fe220533@f29g2000yqa.googlegroups.com> <4295dc09-43de-4557-a095-fc108359f27f@y42g2000yqh.googlegroups.com> <3snehoqgs8ia$.1nobjem6g6hx6$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1322060714 30496 192.74.137.71 (23 Nov 2011 15:05:14 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 23 Nov 2011 15:05:14 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:X/lCP2illW/R/lME6cC58FmXo4c= Xref: news2.google.com comp.lang.ada:14574 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: 2011-11-23T10:05:14-05:00 List-Id: "Yannick Duch�ne (Hibou57)" writes: > Le Mon, 21 Nov 2011 14:08:04 +0100, Robert A Duff > a �crit: >> And there are a few cases where we >> deliberately "cheat" in the RM, by making something raise an exception >> in a generic, when it would normally be a legality rule. > Please, an example! :) In 4.6: 39.1/2 * {AI95-00392-01} If the component types of the array types are anonymous access types, then a check is made that the accessibility level of the operand type is not deeper than that of the target type. [Program_Error is raised at run time if this check fails.] 39.b/2 Reason: This check is needed for operands that are access parameters and in instance bodies. Other cases are handled by the legality rule given previously. If there are no access parameters involved, most implementations will check this rule at compile time of the instance, and give a warning. The only reason it needs to be a run-time check is to avoid breaking the contract model (ignoring the access parameter case), which is sort of a "cheat". - Bob