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: a07f3367d7,c71f34d397d73b8e,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.189.78 with SMTP id dd14mr5896779qab.0.1363878668664; Thu, 21 Mar 2013 08:11:08 -0700 (PDT) X-Received: by 10.49.48.12 with SMTP id h12mr1042230qen.8.1363878668643; Thu, 21 Mar 2013 08:11:08 -0700 (PDT) Path: k8ni5855qas.0!nntp.google.com!dd2no5284037qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 21 Mar 2013 08:11:08 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.59.203.209; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl NNTP-Posting-Host: 129.59.203.209 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4ef5e6b7-aab3-4229-a245-97dfc5861b8d@googlegroups.com> Subject: User-Defined Reference in a Task Type Discriminant Compiler Bug? From: Eryndlia Mavourneen Injection-Date: Thu, 21 Mar 2013 15:11:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-03-21T08:11:08-07:00 List-Id: Dmitry spurred me to investigate user-defined references. ----- 1) The following code does not compile; however, it seems to abide by the L= RM rules in 4.1.5: type Inc_Type is not null access procedure (To_Increment : in out Intege= r); =20 task type T (Incrementing_Procedure : Inc_Type) with Implicit_Dereference =3D> Incrementing_Procedure; and fails with the error not an access discriminant of "T" referencing the aspect clause. ----- 2) Adding "access" before the discriminant type in the task declaration com= piles: type Inc_Type is not null access procedure (To_Increment : in out Intege= r); =20 task type T (Incrementing_Procedure : access Inc_Type) with Implicit_Dereference =3D> Incrementing_Procedure; but I believe that this will produce an access of an access, no? The decla= ration of Inc_Type is not possible, of course, without the keyword "access"= . ----- 3) I tried pleasing the compiler by splitting the declaration, as: type Inc_Type is access procedure (To_Increment : in out Integer); =20 task type T (Incrementing_Procedure : not null Inc_Type) with Implicit_Dereference =3D> Incrementing_Procedure; but Gnat still produces the same error message for the aspect. ----- Note that the declaration of Inc_Type in (1) is properly recognized as an a= ccess-to-subprogram type without the aspect clause. I find it odd that the= declaration of the discriminant + aspect clause given a similar circumstan= ce will not compile. It appears to prevent implicitly the type of construc= t in (1), which seems to me to be legal Ada code. ----- Eryndlia F. Mavourneen