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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3e9f0e99a5a40441,start X-Google-Attributes: gid103376,public From: benari@zeus.datasrv.co.il (Moti Ben-Ari) Subject: Deriving from non-null abstract type Date: 1995/03/29 Message-ID: <3lbh2q$8ov@israel-info.datasrv.co.il>#1/1 X-Deja-AN: 100540680 organization: DataServe LTD. (An Internet Access Provider), Israel. newsgroups: comp.lang.ada Date: 1995-03-29T00:00:00+00:00 List-Id: 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: D: Derived_Type := (Abstract_Type with S); which means that the component General_Info has to be initialized in a separate statement. This seems to be against the philosophy of Ada which provides aggregates so that you won't forget to initialize a component. Is there some way of creating a value that I don't see? If not, why aren't abstract types restricted to null records? Moti Moti Ben-Ari benari@datasrv.co.il