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,5bb6b79919ca8819 X-Google-Attributes: gid103376,public From: je@bton.ac.uk (John English) Subject: Re: problems using classwide types Date: 1997/07/01 Message-ID: <5pb39k$9h4@saturn.brighton.ac.uk>#1/1 X-Deja-AN: 253902501 References: <33B10EF3.72B4@dcs.gla.NOSPAM.ac.uk> Organization: University of Brighton Newsgroups: comp.lang.ada Date: 1997-07-01T00:00:00+00:00 List-Id: andy billimore (billimad@dcs.gla.NOSPAM.ac.uk) wrote: : type Transaction_Type is tagged private; : type Transaction_Ptr_Type is access all Transaction_Type'Class; : type Check_Type is new Transaction_Type with private; : The main program looks like this - : with Transactions; use Transactions; : with Transactions.Checks; use Transactions.Checks; : procedure Main is : L_Check : Check_Type; L_Check : aliased Check_Type; -- so you can get an access value to it : TP : Transaction_Ptr_Type; : begin : TP := new Check_Type; : TP := L_Check; -- Error (see below) -- the value assigned to TP must be of type Transaction_Ptr_Type -- L_Check is a Check_Type, not a Transaction_Ptr_Type, so do this: TP := L_Check'Access; -- i.e. a "pointer" to L_Check : end Main; --------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.comp.it.bton.ac.uk/je Dept. of Computing | fax: (+44) 1273 642405 University of Brighton | ---------------------------------------------------------------