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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.51.141 with SMTP id k135mr1768594itk.19.1516471237464; Sat, 20 Jan 2018 10:00:37 -0800 (PST) X-Received: by 10.157.15.236 with SMTP id m41mr109855otd.7.1516471237371; Sat, 20 Jan 2018 10:00:37 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer02.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!g80no1173430itg.0!news-out.google.com!b73ni4039ita.0!nntp.google.com!w142no1173066ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 20 Jan 2018 10:00:36 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.71.208.22; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 173.71.208.22 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <21b6b4fb-4648-419e-ae6c-c361d54eaa2f@googlegroups.com> Subject: Incomplete type generic formal interactions with Implicit_Dereference From: Jere Injection-Date: Sat, 20 Jan 2018 18:00:37 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 386333583 X-Received-Bytes: 2433 Xref: reader02.eternal-september.org comp.lang.ada:50026 Date: 2018-01-20T10:00:36-08:00 List-Id: Recently I was working in a generic package that had an Incomplete type in its specification. Something like: generic type Some_Type(<>); -- ...other stuff package Some_Package is -- stuff end Some_Package; In it, I needed to return an access type of the Incomplete type, and I figured I would just do that through an implicit derefernced object. I made something like: type Some_Type_Holder(Ref : not null access Some_Type) is limited null record with Implicit_Dereference => Ref; At some point it led to a crash in GNAT, which I reported to AdaCore, and they said they fixed it in a future rev (side note, do I need to report that to the FSF team as well and how if so?). Recently, I've been wondering if what I tried to do was even meant to be legal? I don't actually use Some_Type_Holder directly in the package. It's just a return type of a function for a client to call. Part of me thinks that since Some_Type is incomplete, that Ada wouldn't allow for an Implicit_Dereference declared on it. I guess it depends on if it is meant to be evaluated in the compilation of the generic itself or at the point at which the function is called. Anyone have any thoughts on this?