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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7a3b1c6915ea1273 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.189.202 with SMTP id gk10mr555756pbc.4.1326452310981; Fri, 13 Jan 2012 02:58:30 -0800 (PST) Path: lh20ni177137pbb.0!nntp.google.com!news1.google.com!postnews.google.com!h3g2000yqe.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: How many Ada compiler bugs are here? Date: Fri, 13 Jan 2012 02:52:29 -0800 (PST) Organization: http://groups.google.com Message-ID: <7610c0ee-db98-4530-afab-f29e187ee7d0@h3g2000yqe.googlegroups.com> References: <01dd6341-9c3c-4dcb-90f8-6ac66c65eb66@z1g2000vbx.googlegroups.com> <98adc34c-deed-4190-9e10-755cb886984f@n39g2000yqh.googlegroups.com> <5cm1d9xlavps$.1tjtc88r9ze21$.dlg@40tude.net> <6d352870-d204-4137-a562-5a0b67db1f80@h13g2000vbn.googlegroups.com> <15d37z3l8zllg$.3z2pj9cy5kvq.dlg@40tude.net> NNTP-Posting-Host: 91.7.47.77 Mime-Version: 1.0 X-Trace: posting.google.com 1326452310 8551 127.0.0.1 (13 Jan 2012 10:58:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 13 Jan 2012 10:58:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h3g2000yqe.googlegroups.com; posting-host=91.7.47.77; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.0; rv:8.0.1) Gecko/20100101 Firefox/8.0.1,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-01-13T02:52:29-08:00 List-Id: > >>> Of course this is legal since it's in the scope of the full view (it'= s > >>> a definite type in the full view, an indefinite only in the partial > >>> view). > > >> Only if you have that full view in the function body. > > > What do you want to say? Isn't that exactly what I said? > > package P is > =A0 =A0type T (<>) is private; > private > =A0 =A0type T is new Integer; > end P; That's a severe design mistake. You cannot declare objects of T - there are no constructors. > with P; =A0use P; > package Q is > =A0 =A0function Foo return T; > end Q; You have to declare constructors in P (I know you know that, so why do you write such nonsense?). PS: I know that Foo in your terminology is not a constructor. > package body Q is > =A0 =A0function Foo return T is > =A0 =A0begin > =A0 =A0 =A0 raise Constraint_Error; > =A0 =A0 =A0 return Dummy : T; -- No, that won't work! So what? Yeah, that's not in the scope of the full view. > =A0 =A0end Foo; > end Q; > > The requirement to have a meaningless return might turn to be a serious > trouble. The example above might look constructed, but things like this > happen relatively frequently in large projects. And when they do, it forc= es > interfaces and package hierarchies reworked. Nasty thing. Well, yes, design errors happen. Everyone knows that... But this example is a silly mistake. You know that.