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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: "use" after "limited with" (GNAT bug?) Date: Thu, 14 Aug 2014 21:41:42 +0300 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: AnnUDmZwVERVUXyHDyOl5A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:21771 Date: 2014-08-14T21:41:42+03:00 List-Id: Adam Beneschan wrote: > On Thursday, August 14, 2014 11:08:47 AM UTC-7, Victor Porton wrote: >> -- p1.ads >> >> package P1 is >> >> end P1; >> >> -- p2.ads >> >> limited with P1; >> use P1; >> >> package P2 is >> >> end P2; >> >> >> >> $ gnatmake -q -c -gnatc -u -P/home/porton/t/p/default.gpr p2.ads >> p2.ads:2:05: "P1" is undefined >> gnatmake: "/home/porton/t/p/p2.ads" compilation error >> >> Why "use" does not work? Is it a bug of gnatgcc (Debian 4.9.1-4) 4.9.1? > > It's illegal. You just can't USE a LIMITED WITH'ed package. > > RM 10.1.2, paragraphs 19, 22: > > A limited_with_clause that names a library package shall not appear: > > within a context_clause for a library_item that is within the scope of a > use_clause that names an entity declared within the declarative region of > the library package. > > From the AARM: > > Reason: This prevents visibility issues, where whether an entity is an > incomplete or full view depends on how the name of the entity is written. > The limited_with_clause cannot be useful, as we must have the full view > available in the parent in order for the use_clause to be legal. Not a language lawyer, but may be it makes sense to introduced "limited use" clauses? -- Victor Porton - http://portonvictor.org