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,FROM_WORDY, INVALID_MSGID,T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,93dce172c8d3e2fb X-Google-Attributes: gid103376,public From: Mats.Weber@elca-matrix.ch Subject: Re: Which compiler is correct? Date: 1997/06/23 Message-ID: <867075736.16958@dejanews.com>#1/1 X-Deja-AN: 252023644 References: <33A77C54.5484@bix.com> X-Http-User-Agent: Mozilla/4.0b5 (Macintosh; I; PPC) X-Originating-IP-Addr: 193.72.147.127 (hlm127.elca-matrix.ch) Organization: Deja News Usenet Posting Service X-Article-Creation-Date: Mon Jun 23 14:22:17 1997 GMT X-Authenticated-Sender: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-06-23T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) wrote: > The idea here, is that when you say "type New_Type is new Old_Type ...", > the properties of New_Type are frozen at that point. EXCEPT when this > declaration is inside where Old_Type is declared -- then, at the > earliest place within New_Type's immediate scope where it can see some > additional information about Old_Type, then that information becomes > visible for New_Type. Usually, this doesn't happen. When it does > happen, it's either at the beginning of a private part of a child > package, or at the beginning of the body of a physically-nested package. Sorry, but I still don't get it. What is wrong with the following interpretation of the rules ? package a is type x is tagged private; private type x is tagged record i:integer; end record; end a; package a.b is type y is new x with private; This establishes, among other things, that y inherits x's components. private type y is new x with record j:integer; end record; end a.b; with a.b; package a.c is type z is new a.b.y with private; As y is visibly derived from x, we know that z is an ancestor of x. procedure p; private >From here on, we have visibility on a's private part, and hence on the full declaration of x. The "additional characteristic" that y has an i component becomes visible (because y inherits x's components, and that fact was already established in y's private declaration). type z is new a.b.y with record k:integer; end record; end a.c; package body a.c is procedure p is one:x; two:z; begin one.i:=1; two.k:=2; two.i:=3; -- test_vis.ada: Error: line 31 col 13 LRM:4.1.3(5), No possible interpretation for selected component i, Ignoring future references end p; end a.c; -------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to Usenet