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,FREEMAIL_FROM autolearn=ham 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-15 00:51:53 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.27.83.146!news-FFM2.ecrc.net!news.cesnet.cz!crax.cesnet.cz!news.felk.cvut.cz!not-for-mail From: "Sergey Koshcheyev" Newsgroups: comp.lang.ada Subject: Re: Ambiguous reference - What is wrong with this? Date: Wed, 15 Aug 2001 09:38:06 +0200 Organization: Czech Technical University Message-ID: <9ld8su$eak$1@ns.felk.cvut.cz> References: <9lbf8n$brf$1@nh.pace.co.uk> <9lbo1h$2bhq$1@ns.felk.cvut.cz> <9lc0jf$hod$1@nh.pace.co.uk> NNTP-Posting-Host: q89.dkm.cz X-Trace: ns.felk.cvut.cz 997861086 14676 62.24.82.89 (15 Aug 2001 07:38:06 GMT) X-Complaints-To: usenet@ns.felk.cvut.cz NNTP-Posting-Date: Wed, 15 Aug 2001 07:38:06 +0000 (UTC) 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:11943 Date: 2001-08-15T09:38:06+02:00 List-Id: "Marin David Condic" wrote in message news:9lc0jf$hod$1@nh.pace.co.uk... > Hmmmmmm........ I *think* I understand. This may take a bit of pondering. Well, I should have explained that better, let me try it once more :-) The problem is that you're overloading instead of overriding. And the problem occurs because when Some_Proc is inherited for type Derive1, it turns from procedure Some_Proc (Object : in out Base; Object2 : in out Base'Class); to procedure Some_Proc (Object : in out Derive1; Object2 : in out Base'Class); (note that the type of the Object2 parameter doesn't change) so the Some_Proc you define doesn't override it. > 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. Ada is not covariant, so I'm quite sure an approach using tagged types for both the containers and the elements (in the context of your problem) won't work. > > 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 I think that having the root list package generic and adding new generic parameters to child packages (and thus adding requirements for the stored type) might work, but I haven't tested it and I don't know if it will be appropriate for the problem you're solving. I can provide an example of what I have in mind, if needed. Sergey.