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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Ada design bug or GNAT bug? Date: Sat, 20 Jun 2015 20:55:49 +0200 Organization: cbb software GmbH Message-ID: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: evoS9sCOdnHjo0GRLLMU1Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:26390 Date: 2015-06-20T20:55:49+02:00 List-Id: Is it intentional that there is no way to derive from a more specific type privately? A key design pattern is no more possible in GNAT GPL 2015: package P1 is type T1 is tagged null record; type T2 is new T1 with null record; function Foo return not null access T2; end P1; with P1; use P1; package P2 is type T3 is new T1 with private; private type T3 is new T2 with null record; overriding function Foo return not null access T3; -- Illegal! end P2; p2.ads:5:09: type must be declared abstract or "Foo" overridden p2.ads:5:09: "Foo" has been inherited from subprogram at p1.ads:4 p2.ads:6:24: private function with tagged result must override visible-part function p2.ads:6:24: move subprogram to the visible part (RM 3.9.3(10)) [ Since when access types became tagged? ] There seem no way to implement T3 by deriving from T2. *Any* declaration of Foo would be illegal. 1. It cannot be inherited 2. A public declaration is not an overriding 3. A private declaration must be public -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de