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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7b4ed0d42717e891 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: [Technical] Generic child parameterised with instance of parent Date: 1998/11/26 Message-ID: <365D6AFE.D3BEE7D1@elca-matrix.ch>#1/1 X-Deja-AN: 415901062 Content-Transfer-Encoding: 7bit References: X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-11-26T00:00:00+00:00 List-Id: Michel Gauthier wrote: > Here is the need as I can identify it (possibly not in a right way). > Then can be compiled. But the compiler rejects > package InstChild is new P1Some . Child ( P1Other ) ; GNAT 3.11b accepts this, and does not need the G1bis declaration, so it does not seem to take G1 as denoting the current instance within the generic formal part of G1.Child. I don't know if that is right or not. Here is the exact code that I compiled: with G1.Child; procedure Gauthier_Generic_Child is type Some_Type is new Integer; type Other_Type is new Float; package P1_Some is new G1 ( some_type ) ; package P1_Other is new G1 ( other_type ) ; package InstChild is new P1_Some . Child ( P1_Other ) ; begin null; end; --- generic with package GP is new G1 ( <> ) ; package G1 . Child is end; --- generic type ITEM is private; package G1 is end G1;