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,93dce172c8d3e2fb X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Which compiler is correct? Date: 1997/06/19 Message-ID: #1/1 X-Deja-AN: 251406821 X-NNTP-Posting-Host: pogner.demon.co.uk [158.152.70.98] References: <33A77C54.5484@bix.com> Organization: At Home Newsgroups: comp.lang.ada Date: 1997-06-19T00:00:00+00:00 List-Id: bobduff@world.std.com (Robert A Duff) writes: > In article <33A77C54.5484@bix.com>, Tom Moran wrote: > >Compilers G and J accept this code. Compiler O gives the error message > >indicted in the comment, on said line. Which is correct Ada? > > Compiler O is correct. The inherited i component of type y is > implicitly declared within the private part of a.b. Since a.c cannot > see this implicit declaration, the i component of z is never implicitly > declared (although it still exists at run time, and you can get at it by > doing "x(two).i"). a.c's body can see the full view of type a.x a.c's body can only see the partial view of type a.b.y the partial view of type a.b.y says it's a new a.x so how come the a.x bits of a.b.y aren't visible to a.c's body? (I'm sure it's true if you say so; I just think most people, after they've seen this sort of problem and fumbled their way to a resolution a few times, will have a private spellbook from which they will select incantations until they find one that works. So what's new, you say) -- Simon Wright Work Email: simon.j.wright@gecm.com GEC-Marconi Radar & Defence Systems Voice: +44(0)1705-701778 Command & Information Systems Divsion FAX: +44(0)1705-701800