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=-1.7 required=3.0 tests=BAYES_00,NICE_REPLY_A, REPLYTO_WITHOUT_TO_CC,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: renaming as classwide type Date: Thu, 21 Sep 2023 23:03:02 +0200 Organization: A noiseless patient Spider Message-ID: References: <99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 21 Sep 2023 21:03:03 -0000 (UTC) Injection-Info: dont-email.me; posting-host="c7e243b1f5102ec95f19a1728543ba80"; logging-data="3892436"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iVrTCgvU0qkixPVesBHDUSVpkSS0gOrk=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Cancel-Lock: sha1:YZFg2n558FxxUEuJTbrQreB0zfw= In-Reply-To: <99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com> Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:65689 List-Id: On 21.09.23 21:29, Simon Belmont wrote: > is it really illegal to rename an object as it's classwide parent? gnat claims so. Similar results using a type extension as a generic formal "in out" object of classwide type. > > declare > type P is interface; > type C is new P with null record; > > o : C; > r : P'Class renames o; --error > begin > null; > end; > > expected type "P'Class" defined at line > found type "C" defined at line O does not denote an object of a class-wide type, I think. However, P'Class (o) does, so that renaming that would make r be of its declared type P'Class.