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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Ada Successor Language Date: Mon, 25 Jun 2018 14:41:10 +0200 Organization: Adalog Message-ID: References: <5e86db65-84b9-4b5b-9aea-427a658b5ae7@googlegroups.com> <878t7u1cfm.fsf@nightsong.com> <776f3645-ed0c-4118-9b4d-21660e3bba4b@googlegroups.com> <87602fbu2g.fsf@nightsong.com> <87po0mziqt.fsf@nightsong.com> <87fu1izfgs.fsf@nightsong.com> <878t75nwad.fsf@adaheads.home> NNTP-Posting-Host: vtydEJu0RziDZHka7ZZ6bg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 X-Notice: Filtered by postfilter v. 0.8.3 Openpgp: preference=signencrypt Content-Language: fr Xref: reader02.eternal-september.org comp.lang.ada:53296 Date: 2018-06-25T14:41:10+02:00 List-Id: Le 25/06/2018 à 10:58, Alejandro R. Mosteo a écrit : > See this one, which is the case that bit me recently: > > procedure Blah is >     generic >         type Something is private; >     package Duh is        >         type Meh is new Something;        >     end Duh; > >     type Oh is tagged null record; >      >     package Ouch is new Duh (Oh); > > begin >    null; > end Blah; A private formal allows tagged and untagged types. However, deriving without extension is legal only for untagged types. Since it is a specification (that you are supposed to have read), the compiler assumes the best and allows the derivation. When you instantiate with a tagged type, you would be doing something illegal and the instantiation is not allowed. The same derivation would not compile in the body of the generic, where the worst is assumed. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr