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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.36.15 with SMTP id r15mr78709302qad.8.1375131281031; Mon, 29 Jul 2013 13:54:41 -0700 (PDT) X-Received: by 10.50.153.80 with SMTP id ve16mr575243igb.8.1375131280990; Mon, 29 Jul 2013 13:54:40 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.swapon.de!news.glorb.com!cb17no8661qab.0!news-out.google.com!ij2ni119qab.0!nntp.google.com!cb17no8660qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 29 Jul 2013 13:54:40 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 69.20.190.126 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <56e81849-4303-4a78-878c-fff8b57ce64f@googlegroups.com> Subject: Private function w/ Tagged return-type. From: Shark8 Injection-Date: Mon, 29 Jul 2013 20:54:41 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:16601 Date: 2013-07-29T13:54:40-07:00 List-Id: Given the following: with Ada.Streams; package example is Type Subject is tagged private; function Create return Subject; private function Input( Stream : not null access Ada.Streams.Root_Stream_Type'Class) return Subject is (Create); ---- private, moved here, will work. =20 Type Subject is tagged null record with Input =3D> Input; function Create return Subject is (null record); end example; yields the following error message: private function with tagged result must override visible-part functio= n move subprogram to the visible part (RM 3.9.3(10)) Yet, the given paragraph says: For an abstract type declared in a visible part, an abstract primitive s= ubprogram shall not be declared in the private part, unless it is overridin= g an abstract subprogram implicitly declared in the visible part. For a tag= ged type declared in a visible part, a primitive function with a controllin= g result or a controlling access result shall not be declared in the privat= e part, unless it is overriding a function implicitly declared in the visib= le part. Is the error correct? 'Input, 'Output, 'Read & 'Write are implicitly create= d due to the stream operations/attributes, though arguably they are not fun= ctions/subprograms. I should think that it would be perfectly appropriate to place the declarat= ions of the functions you're assigning to 'Read/'Write/'Input/'Output into = the private portion of the package.