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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.107.3.79 with SMTP id 76mr4791639iod.134.1522687176460; Mon, 02 Apr 2018 09:39:36 -0700 (PDT) X-Received: by 2002:a9d:554b:: with SMTP id h11-v6mr591422oti.12.1522687176249; Mon, 02 Apr 2018 09:39:36 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!paganini.bofh.team!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!u184-v6no4166658ita.0!news-out.google.com!u64-v6ni5389itb.0!nntp.google.com!u184-v6no4166653ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 2 Apr 2018 09:39:36 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.245.160.83; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.245.160.83 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: changing rules for anonymous access types to named ones From: Jean-Claude Rostaing <00120260a@gmail.com> Injection-Date: Mon, 02 Apr 2018 16:39:36 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:51297 Date: 2018-04-02T09:39:36-07:00 List-Id: Hi. There's definitely a change in rules from 95 to 2012 I spotted, which makes things more ugly: that: Set(new Plus_Operator); was written for ada95. Now, it gives the error: expected type "TOKEN_ACCESS" defined at expressions.ads:22 found type access to "Plus_Operator" defined at line 48 TOKEN_ACCESS is merely a named access type to TOKEN_TYPE'class, which PLUS_OPERATOR is a child of. I made a compilable exemple of my case: with ada.Text_IO; use ada.Text_IO; procedure ESSAI is type A is abstract tagged limited null record; type A_Child is new A with null record; type pointers_A is access A'CLASS; type B is interface; type B_child is new B with null record; type pointers_B is access b'CLASS; function F1 (obj: pointers_A) return INTEGER is (1); function F2 (obj: pointers_b) return INTEGER IS (1); begin PUT_LINE("avec abstract tagged null record : " & INTEGER'IMAGE(F1(new A_child)); Put_Line("AVEC interface : " & INTEGER'IMAGE(F2(new B_child)); end; Only the second statement fails. I could find nothing in the access type section related to interface nor the reciprocal so I'm sure it's not normal.