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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2bf2853c7c95c600 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed-0.progon.net!progon.net!news-zh.switch.ch!switch.ch!cernne03.cern.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Dispatching operations Date: Wed, 09 Nov 2005 09:38:35 +0100 Organization: CERN - European Laboratory for Particle Physics Message-ID: References: NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1131525515 12824 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Red Hat/1.7.12-1.1.3.2.SL3 X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:6323 Date: 2005-11-09T09:38:35+01:00 List-Id: Jeffrey R. Carter wrote: >> My confusion is that Op_B is private in P2. X is declared in P2 as >> well. In the above call, I'd expect P2.Op_B to be called (which is >> actually the case), but since everything is known statically, then I'd >> expect as well to get compile-time error due to the fact that P2.Op_B >> is private. > > The important point is in 20.f: "The overriding declaration for P2.Op_B > is not visible in Main, so the name in the call actually denotes the > implicit declaration of Op_B inherited from T1." > > Note that there is an implicit declaration of Op_B in P2 at the point of > the type extension. > > Also note that X is not declared in P2; it is declared in Main. Thanks, this clears thing a bit. The question remains, though: how can I get compile error when calling private P2.Op_B? If it's not possible, what's the point in making it private? When I make this operation (P2.Op_B) public, the it hides the one inherited from P1.T1 and it is no longer possible to call P2.Op_B(Arg => X), because the named association of parameter is wrong. This means that by "promoting" something from private to public (!) in the given package I can break the existing client of that package. This is a strange concept to me. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/