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.66.65.131 with SMTP id x3mr20809441pas.13.1407786995871; Mon, 11 Aug 2014 12:56:35 -0700 (PDT) X-Received: by 10.140.32.227 with SMTP id h90mr31795qgh.26.1407786995821; Mon, 11 Aug 2014 12:56:35 -0700 (PDT) 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!news.glorb.com!h18no18363144igc.0!news-out.google.com!b3ni24360qac.1!nntp.google.com!j15no6343277qaq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 11 Aug 2014 12:56:35 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Accessibility check failed From: sbelmont700@gmail.com Injection-Date: Mon, 11 Aug 2014 19:56:35 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:21667 Date: 2014-08-11T12:56:35-07:00 List-Id: On Sunday, August 10, 2014 10:12:37 PM UTC-4, hreba wrote: >=20 > So what is wrong? >=20 What's probably happening is that the item you are passing in is declared a= t the procedure level. A check is done when you do the cast to make sure t= hat no dangling references could potentially happen. If you declare it at = a higher scope, I would wager success. For instance: procedure main is x : aliased test_lists_aux.ItemD :=3D (Gen.Lists.ItemD with ch =3D> '!')= ; x_p : test_lists_aux.Item :=3D new test_lists_aux.ItemD'(Gen.Lists.ItemD= with ch =3D> '!'); y : test_lists_aux.Writer; begin test_lists_aux.Proc (w =3D> y, itm =3D> x_p); -- pass, lifetime is forever test_lists_aux.Proc (w =3D> y, itm =3D> x'access); -- fail, lifetime is only this = scope end test; -sb