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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d58fe1ff04da7fd7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-14 13:15:13 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Ambiguous reference - What is wrong with this? Date: Tue, 14 Aug 2001 16:10:19 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9lc0jf$hod$1@nh.pace.co.uk> References: <9lbf8n$brf$1@nh.pace.co.uk> <9lbo1h$2bhq$1@ns.felk.cvut.cz> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 997819823 18189 136.170.200.133 (14 Aug 2001 20:10:23 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 14 Aug 2001 20:10:23 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:11937 Date: 2001-08-14T20:10:23+00:00 List-Id: Hmmmmmm........ I *think* I understand. This may take a bit of pondering. In any event, it isn't clear how I get out of it considering thatI'd kind of like to keep the second parameter a 'Class wide type. I'll have to cogitate on this - but it appears I may not be able to get there from here. If I'm creating overloadings and qualifying the overloadings isn't disambiguating them, then it seems the only answer is to create new names. However doing so means the child class a couple of layers down can't hide some operation of one of its parents. I'd like to be able to say my list can only accept elements of some subclass and increasingly restrict that subclass (see other posts in this thread.) By removing the 'Class qualification, I may avoid the ambiguity, but may not be able to preserve the subsets I want to have. Hmmmmmmm............ MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Sergey Koshcheyev" wrote in message news:9lbo1h$2bhq$1@ns.felk.cvut.cz... > > It looks to me that the problem is this: when you derive a type from some > other type, the derived type gets the primitive operations of the parent. > However, the dispatching parameter type (I'm not sure if it's the correct > terminology) gets changed from the base type to the derived type. The > parameter of type 'Class, on the other hand, remains untouched. > What this leads to is this: when you declare Some_Proc for the Derive1 type, > it does not override the Some_Proc of Base, but *overloads* it. This means > that the type Derive1 has *two* primitive operations, and the type Derive2 > has three. They are: > > procedure Some_Proc > (Object : in out Derive2; > Object2 : in out Base'Class); > procedure Some_Proc > (Object : in out Derive2; > Object2 : in out Derive1'Class); > procedure Some_Proc > (Object : in out Derive2; > Object2 : in out Derive2'Class); > > and these are the three operations that the compiler can't choose from. A > way to overcome this problem would be to rename the Some_Proc you actually > call to some other name. Qualifying the parameters, like > Root.Child1.Some_Proc ( > Object => Root.Child1.Derive1 (Object), > Object2 => Root.Child1.Derive1'Class'(Object2)) ; > (note the qualification of Object2) doesn't work. >