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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bfbc780dd8e1c97c,start X-Google-Attributes: gid103376,public From: adam@irvine.com Subject: Question about generic formal derived types Date: 1999/03/30 Message-ID: <7dpgl4$h2j$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 460589651 X-Http-Proxy: 1.0 x2.dejanews.com:80 (Squid/1.1.22) for client 192.160.8.21 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue Mar 30 03:32:52 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/3.0 (X11; I; Linux 2.0.34 i686) Date: 1999-03-30T00:00:00+00:00 List-Id: In this program fragment: ------------------------------------------------------------------------------- package Pack1 is type Root_Type is tagged record Field1 : Integer; Field2 : Boolean; end record; end Pack1; with Pack1; generic type Formal_Type is new Pack1.Root_Type with private; package Pack2 is type New_Type is new Formal_Type with record Field3 : Character; end record; end Pack2; with Pack1; package Pack3 is type Root_Type_Extension is new Pack1.Root_Type with record Field3 : Float; end record; end Pack3; . . . with Pack2; with Pack3; package body Pack4 is package Instantiation is new Pack2 (Pack3.Root_Type_Extension); procedure Inner is X : Character; Y : Instantiation.New_Type; begin X := Y.Field3; end Inner; end Pack4; ------------------------------------------------------------------------------- I can't believe that a record type can have two components of the same name, but it appears that Instantiation.New_Type would have two components named Field3. When Y.Field3 is accessed, which Field3 is meant? Which language rules in the RM govern this situation? -- thanks, Adam -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own