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.7 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,92a6dd552088ca30 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: "Rego, P." Newsgroups: comp.lang.ada Subject: Re: Constructor for a class with a task defined Date: Sat, 3 Sep 2011 08:18:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: <438414c7-9b01-44ef-8a17-f21d4ef34f58@glegroupsg2000goo.googlegroups.com> References: Reply-To: comp.lang.ada@googlegroups.com NNTP-Posting-Host: 187.56.110.1 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1315063889 933 127.0.0.1 (3 Sep 2011 15:31:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 3 Sep 2011 15:31:29 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=187.56.110.1; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu User-Agent: G2/1.0 X-Google-Web-Client: true Xref: g2news1.google.com comp.lang.ada:20839 Date: 2011-09-03T08:18:17-07:00 List-Id: I tried all the suggestions (thanks to all!), but the ones which uses "<>" I got the message box when I included other constructor subclasses inside Small_Class (but worked pretty well in the simpler version): raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:423 gnatmake: "D:\src\mypkg.adb" compilation error The one suggested by Simon worked as well too (and it was which I choose to use), but maybe a basic question: what is the difference between using the direct access approach in a local procedure and using the _P approach? I mean, before I had tried to use function Construct return access Small_Class is B : access Small_Class := new Small_Class; begin return B; end Construct; and got the message "cannot convert local pointer to non-local access type" so why does the (type Small_Class_Acc is access all Small_Class;) code function Construct return access Small_Class is B : Small_Class_Acc := new Small_Class; begin return B; end Construct; works? Should not it get me the same msg?