From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:620a:9048:b0:76f:2990:2d88 with SMTP id rl8-20020a05620a904800b0076f29902d88mr308948qkn.9.1694033703066; Wed, 06 Sep 2023 13:55:03 -0700 (PDT) X-Received: by 2002:a63:3c4a:0:b0:570:26e:1606 with SMTP id i10-20020a633c4a000000b00570026e1606mr3522062pgn.2.1694033702655; Wed, 06 Sep 2023 13:55:02 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 6 Sep 2023 13:55:02 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1210:2e90:8100:88f4:a68c:e354:e61; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 2a02:1210:2e90:8100:88f4:a68c:e354:e61 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8aec1f64-32e8-4815-8676-dc41ce353e3fn@googlegroups.com> Subject: Re: Equivalence between named access and anonymous access. From: Gautier write-only address Injection-Date: Wed, 06 Sep 2023 20:55:03 +0000 Content-Type: text/plain; charset="UTF-8" Xref: news.eternal-september.org comp.lang.ada:65607 List-Id: > 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;