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 2002:a24:688b:: with SMTP id v133-v6mr7053762itb.0.1521911776112; Sat, 24 Mar 2018 10:16:16 -0700 (PDT) X-Received: by 2002:a9d:3464:: with SMTP id v91-v6mr888678otb.4.1521911775895; Sat, 24 Mar 2018 10:16:15 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!news.roellig-ltd.de!open-news-network.org!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u184-v6no1927837ita.0!news-out.google.com!j10-v6ni2119ite.0!nntp.google.com!199-v6no1936380itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 24 Mar 2018 10:16:15 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.243.124.96; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.243.124.96 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: representation clauses ok in generics when the formal type in tagged with known ancestor, but not ok when only know to be tagged ? ... said the compiler. From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Sat, 24 Mar 2018 17:16:16 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2173 X-Received-Body-CRC: 2914694032 Xref: reader02.eternal-september.org comp.lang.ada:51193 Date: 2018-03-24T10:16:15-07:00 List-Id: This is a translation from fr.c.l.a. I wonder why in some cases where a generic formal type is a tagged type and has a known ancestor, one can alter the representation: package AAA is type Type_A is tagged record INT: INTEGER; end record; end AAA; with AAA; use AAA; generic type NT is new type_A with private; package TENTATIVE is type B_Type is new Nt with null record with SIZE => 300; procedure P1 (B : B_Type) is NULL; end TENTATIVE; with AAA, TENTATIVE; use AAA; procedure MAIN is package TEST is new TENTATIVE(Type_A); begin Null; end; It only gives me "main.adb:3:01: warning: in instantiation at tentative.ads:5 main.adb:3:01: warning: 172 bits of "B_Type" unused" It compiles, while when the contract states that NT has only to be tagged, it failed. To change "type NT is new TYPE_A with private" into "type NT is tagged private" gives "tentative.ads:5:48: representation item not allowed for generic type" JPRosen couldn't help on this, and said you Randy could saw to it better ;-)