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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Problem with limited with Date: Fri, 26 Jul 2013 13:49:08 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 26 Jul 2013 20:42:50 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="68bb7ebc916066bb85146425b2aa8565"; logging-data="30071"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GdESk5cDXdCFlPvAxEoA0xQw7OmB1XLQ=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Cancel-Lock: sha1:kd0hM/zqHROb+OY2Sc1aA7Yeldw= X-Original-Bytes: 2326 Xref: number.nntp.dca.giganews.com comp.lang.ada:182692 Date: 2013-07-26T13:49:08-07:00 List-Id: On 07/26/2013 12:14 PM, Simon Wright wrote: > > limited with Pak2; > package Pak1 is > type Pak2_T2_P is access all Pak2.T2; > task type T1 is > entry E1 (T2 : Pak2_T2_P); > end T1; > end Pak1; > > package Pak2 is > task type T2 is > entry E2; > end T2; > end Pak2; > > with Pak2; > package body Pak1 is > task body T1 is > The_T2 : Pak2_T2_P; > begin > accept E1 (T2 : Pak2_T2_P) do > The_T2 := T2; > end E1; > The_T2.E2; -- compilation fails > The_T2.all.E2; -- compilation succeeds > end T1; > end Pak1; The best solution is to avoid limited with: with Pak2; package Pak1 is task type T1 is entry E1 (T2 : Pak2.T2); end T1; end Pak1; package body Pak1 is task body T1 is begin accept E1 (T2 : Pak2.T2) do T2.E2; end E1; end T1; end Pak1; -- Jeff Carter "What I wouldn't give for a large sock with horse manure in it." Annie Hall 42