From: Gautier write-only address <gautier_niouzes@hotmail.com>
Subject: Re: Equivalence between named access and anonymous access.
Date: Wed, 6 Sep 2023 13:55:02 -0700 (PDT) [thread overview]
Message-ID: <8aec1f64-32e8-4815-8676-dc41ce353e3fn@googlegroups.com> (raw)
In-Reply-To: <uda2ql$2hle9$1@dont-email.me>
> In the following Ada code, are the writing of parameter P1 type of
> procedures PA and PB equivalent ?
They are not equivalent because the anonymous access opens more possibilities (example below), but you are certainly aware of that.
So I guess you have another question in mind...
with C1, C2;
procedure test is
x2 : C2.Inst;
type My_Reference_1 is access all C1.Inst'Class;
r1 : My_Reference_1;
begin
x2.PB (r1);
x2.PA (r1);
-- ^ expected type "Class" defined at c1.ads:3
-- found type "My_Reference_1" defined at line 6
end;
next prev parent reply other threads:[~2023-09-06 20:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 14:37 Equivalence between named access and anonymous access Blady
2023-09-06 15:54 ` Dmitry A. Kazakov
2023-09-07 16:06 ` Blady
2023-09-07 16:18 ` Jeffrey R.Carter
2023-09-07 19:10 ` Blady
2023-09-07 20:23 ` Dmitry A. Kazakov
2023-09-06 20:55 ` Gautier write-only address [this message]
2023-09-07 0:20 ` Jeffrey R.Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox