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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,735c710b5e547bad,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.223.73 with SMTP id qs9mr2282385pbc.7.1342097640399; Thu, 12 Jul 2012 05:54:00 -0700 (PDT) Path: l9ni11511pbj.0!nntp.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Ada 2005 puzzle Date: Thu, 12 Jul 2012 14:54:08 +0200 Organization: cbb software GmbH Message-ID: <1arp60wtxes8h$.1qs6bt732ztgp.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-07-12T14:54:08+02:00 List-Id: Here is a simplified case illustrating an issue with constructing functions and limited aggregates: -------------------------------------------- package P with Ada.Finalization; package P is type T (<>) is new Ada.Finalization.Limited_Controlled with private; function Create return T; private type T is new Ada.Finalization.Limited_Controlled with null record; end P; - - - - - - - - - - - - - - - - - - - - - - - - package body P is function Create return T is begin return (Ada.Finalization.Limited_Controlled with null record); end Create; end P; -------------------------------------------- package Q with P; use P; package Q is type S is abstract new T with null record; type R is new S with null record; overriding function Create return R; end Q; - - - - - - - - - - - - - - - - - - - - - - - - package body Q is function Create return R is begin return (T'(Create) with null record); -- Error! end Create; end Q; Is there a way to implement Create (without compromising the package P)? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de