From: sbelmont700@gmail.com
Subject: Re: Accessibility check failed
Date: Mon, 11 Aug 2014 12:56:35 -0700 (PDT)
Date: 2014-08-11T12:56:35-07:00 [thread overview]
Message-ID: <fec9c4a0-7084-431b-8071-7ae6910d823f@googlegroups.com> (raw)
In-Reply-To: <c4qn4nFbplvU1@mid.individual.net>
On Sunday, August 10, 2014 10:12:37 PM UTC-4, hreba wrote:
>
> So what is wrong?
>
What's probably happening is that the item you are passing in is declared at the procedure level. A check is done when you do the cast to make sure that 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 := (Gen.Lists.ItemD with ch => '!');
x_p : test_lists_aux.Item := new test_lists_aux.ItemD'(Gen.Lists.ItemD with ch => '!');
y : test_lists_aux.Writer;
begin
test_lists_aux.Proc (w => y,
itm => x_p); -- pass, lifetime is forever
test_lists_aux.Proc (w => y,
itm => x'access); -- fail, lifetime is only this scope
end test;
-sb
next prev parent reply other threads:[~2014-08-11 19:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-11 2:12 Accessibility check failed hreba
2014-08-11 5:32 ` Jeffrey Carter
2014-08-11 16:45 ` hreba
2014-08-11 16:55 ` Jeffrey Carter
2014-08-12 11:57 ` hreba
2014-08-11 19:56 ` sbelmont700 [this message]
2014-08-11 20:17 ` Jeffrey Carter
2014-08-11 20:28 ` sbelmont700
2014-08-11 21:14 ` Jeffrey Carter
-- strict thread matches above, loose matches on Subject: below --
2015-11-29 18:03 accessibility " Serge Robyns
2015-11-29 18:37 ` Jeffrey R. Carter
2015-11-29 19:00 ` Serge Robyns
2015-11-29 22:32 ` Jeffrey R. Carter
2015-11-29 22:53 ` Serge Robyns
2015-11-30 2:04 ` Jeffrey R. Carter
2015-11-30 23:22 ` Randy Brukardt
2015-12-01 9:38 ` Serge Robyns
2015-11-29 19:15 ` Dmitry A. Kazakov
2015-11-29 22:40 ` Serge Robyns
2015-12-01 20:17 ` sbelmont700
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox