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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3e9f0e99a5a40441 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-29 18:56:19 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!msunews!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!uqcspe.cs.uq.oz.au!cs.uq.oz.au!dan From: dan@cs.uq.oz.au (Dan Johnston D.B.) Newsgroups: comp.lang.ada Subject: Re: Deriving from non-null abstract type Date: 30 Mar 1995 01:53:48 GMT Organization: Computer Science Dept, University of Queensland Distribution: world Message-ID: <3ld2vc$1cu@uqcspe.cs.uq.oz.au> References: <3lbh2q$8ov@israel-info.datasrv.co.il> Reply-To: dan@cs.uq.oz.au NNTP-Posting-Host: camellia.cs.uq.oz.au Date: 1995-03-30T01:53:48+00:00 List-Id: In <3lbh2q$8ov@israel-info.datasrv.co.il> benari@zeus.datasrv.co.il (Moti Ben-Ari) writes: >I would like to derive from a _non-null_ abstract tagged type: > type Abstract_Type is abstract tagged > record > General_Info: Some_Type; > end record; > type Derived_Type is new Abstract_Type with > record > Special_Info: Some_Other_Type; > end record; >Of course, you can't create a value of the abstract type, >but it turns out that it is impossible to create a value >of the derived type: > D: Derived_Type := (G with S); >because G would have to be an aggregate of an abstract type >which is illegal. The only thing you can do is: You can use an ordinary aggregate ( General_Info => Some_Type, Special_Info => Some_Other_Type ) I sympathise because this problem had me hung up for a considerable time too. You (and I also) obviously expected that an aggregate of an extension type must be an extension-aggregate, but this is not the case. The only real confirmation of this that I can find in the manual is the last example in section 3.9.1 where the Painted_Point aggregate is an example of an extended type represented as an ordinary aggregate. Perhaps there should be a note in section 3.9.2 of the manual saying that aggregates of extended types don't have to be extension-aggregates. dan. dan@cs.uq.oz.au