From: Victor Porton <porton@narod.ru>
Subject: Re: "use" after "limited with" (GNAT bug?)
Date: Thu, 14 Aug 2014 21:41:42 +0300
Date: 2014-08-14T21:41:42+03:00 [thread overview]
Message-ID: <lsivt6$ecc$1@speranza.aioe.org> (raw)
In-Reply-To: f03ffc27-3d37-4af0-b8c3-9f4bc07cc6ee@googlegroups.com
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
next prev parent reply other threads:[~2014-08-14 18:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-14 18:08 "use" after "limited with" (GNAT bug?) Victor Porton
2014-08-14 18:37 ` Adam Beneschan
2014-08-14 18:41 ` Victor Porton [this message]
2014-08-15 0:52 ` Shark8
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox