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,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99f33f51845a7793 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-15 13:04:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!sn-xit-01!sn-xit-04!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: 'withing' problem Date: Thu, 15 Nov 2001 16:07:59 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3be27344$0$227$ed9e5944@reading.news.pipex.net> <3BE42900.7590E899@adaworks.com> <3be65f4c$0$237$ed9e5944@reading.news.pipex.net> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:16591 Date: 2001-11-15T16:07:59-05:00 List-Id: "Simon Wright" wrote in message news:x7vu1vv6b02.fsf@smaug.pushface.org... > Does your Patient_Forward solution extends to declaring Doctor_Forward > similarly? I get trouble at > > procedure Visit_Doctor > (Patient : in out Patient_Type; > Doctor : in out Root_Doctor'Class) is > begin > Treat_Patient (Doctor, Patient); > patients.adb:9:22: expected type "Doctor_Type" defined at doctors.ads:6 > patients.adb:9:22: found type "Root_Doctor'Class" defined at doctors_forward.ads:3 > end; You have to make another renaming declaration, like you did in the Doctor body: procedure Visit_Doctor (Patient : in out Patient_Type; Doctor : in out Root_Doctor'Class) is D : Doctor_Type'Class renames Doctor_Type'Class (Doctor); begin Treat_Patient (D, Patient); end; You got a compile error because Treat_Patient is not an operation of type Root_Doctor. To fix it, you have to downcast from type Root_Doctor'Class to Doctor_Type'Class.