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,b18ccf7d301fe37 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-22 06:24:17 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: michael.jackson5@virgin.net (Mike) Newsgroups: comp.lang.ada Subject: Re: Invoking abstract subprograms in Ada95 Date: 22 Apr 2002 06:24:15 -0700 Organization: http://groups.google.com/ Message-ID: <2dbd76f3.0204220524.158132bb@posting.google.com> References: NNTP-Posting-Host: 195.166.25.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1019481857 11104 127.0.0.1 (22 Apr 2002 13:24:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 22 Apr 2002 13:24:17 GMT Xref: archiver1.google.com comp.lang.ada:22898 Date: 2002-04-22T13:24:17+00:00 List-Id: "Grein, Christoph" wrote in message news:... > The following compiles fine (with Rational Apex): > > > package Abstract_Class_Wide is > > type T is abstract tagged null record; > > procedure P (X : T) is abstract; > > procedure C (X : T'Class); > > end Abstract_Class_Wide; > > > > package body Abstract_Class_Wide is > > procedure C (X : T'Class) is > begin > P (X); > end C; > > end Abstract_Class_Wide; Hmm - the only differences I can see here are that my abstract method also takes a classwide type, and is implemented in a child package. Here's the distilled problem: -- package abstract_bit is type A is abstract tagged null record; procedure generalOperation( this : in out A'class ); procedure specificOperation( this : in out A'class ) is abstract; end abstract_bit; -- package body abstract_bit is procedure generalOperation( this : in out A'class ) is begin specificOperation( this => this ); end generalOperation; end abstract_bit; -- package abstract_bit.concrete_bit is type C is new A with null record; procedure specificOperation( this : in out C ); end abstract_bit.concrete_bit; -- package body abstract_bit.concrete_bit is procedure specificOperation( this : in out C ) is begin null; end specificOperation; end abstract_bit.concrete_bit; -- main program with abstract_bit.concrete_bit; procedure annoying is thingy : abstract_bit.concrete_bit.C; begin abstract_bit.generalOperation( thingy ); end annoying; Mike