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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,436e4ce138981b82 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-07 04:39:22 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: abstract sub programs overriding Date: 07 Mar 2004 12:35:35 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <5f59677c.0403021101.4ac263d0@posting.google.com> <5f59677c.0403060718.3d6aa909@posting.google.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1078663161 1740 62.49.19.209 (7 Mar 2004 12:39:21 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 7 Mar 2004 12:39:21 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:6116 Date: 2004-03-07T12:35:35+00:00 List-Id: Marius Amado Alves writes: > It's very simple, really: you can only call concrete, and of course > available, operations. > > In your program you had an abstract (not concrete) Generate (for a > 'root' type), and a concrete, but not available Generate (for a > derived type). The concrete Generate was not available (at the point > of the call) because it was declared in the private part of a > separate unit. So the first was available but was not concrete, the > second was not available, GNAT went for the only available one, and > naturally failed, mumbling whatever GNAT mumbles when it tries to > call an abstract operation. I'm sure this explanation isn't right. The pointer concerned is to a classwide type, and the contract says that any actual Element_Record has a concrete (callable) Generate operation. It would be easy to construct a program where Main had access to an Element (the classwide pointer) but not to Generator.Declarations (where the concrete type is defined). I agree that putting it in the private part is perhaps misleading, but that doesn't mean it's wrong -- we need a lawyer! I have seen GNAT bugs where a type was privately controlled .. For info, the OP's program executes just fine under Object Ada 7.2.2. -- Simon Wright 100% Ada, no bugs.