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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c71f34d397d73b8e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.172.134 with SMTP id l6mr158340qaz.7.1363893178178; Thu, 21 Mar 2013 12:12:58 -0700 (PDT) X-Received: by 10.50.186.133 with SMTP id fk5mr803312igc.0.1363893178128; Thu, 21 Mar 2013 12:12:58 -0700 (PDT) Path: k8ni8560qas.0!nntp.google.com!dd2no5551907qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 21 Mar 2013 12:12:57 -0700 (PDT) In-Reply-To: <4ef5e6b7-aab3-4229-a245-97dfc5861b8d@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <4ef5e6b7-aab3-4229-a245-97dfc5861b8d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <65c510a2-1571-4730-b264-501b6b861346@googlegroups.com> Subject: Re: User-Defined Reference in a Task Type Discriminant Compiler Bug? From: Adam Beneschan Injection-Date: Thu, 21 Mar 2013 19:12:58 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-03-21T12:12:57-07:00 List-Id: On Thursday, March 21, 2013 8:11:08 AM UTC-7, Eryndlia Mavourneen wrote: > Dmitry spurred me to investigate user-defined references. > > 1) The following code does not compile; however, it seems to abide by the LRM rules in 4.1.5: > type Inc_Type is not null access procedure (To_Increment : in out Integer); > > task type T (Incrementing_Procedure : Inc_Type) > with Implicit_Dereference => Incrementing_Procedure; > > and fails with the error > > not an access discriminant of "T" > > referencing the aspect clause. Right. An "access discriminant" isn't any old discriminant with an access type; 3.7(9/2) says "A discriminant that is defined by an access_definition is called an access discriminant and is of an anonymous access type." So to be an "access discriminant" it has to have the word "access" in it, e.g. task type T (Incrementing_Procedure : not null access procedure (To_Increment : in out integer)) with Implicit_Dereference => Incrementing_Procedure; > 2) Adding "access" before the discriminant type in the task declaration compiles: > > type Inc_Type is not null access procedure (To_Increment : in out Integer); > > task type T (Incrementing_Procedure : access Inc_Type) > with Implicit_Dereference => Incrementing_Procedure; > > but I believe that this will produce an access of an access, no? Right. I don't think that's what you want. -- Adam