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, WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5bb6b79919ca8819,start X-Google-Attributes: gid103376,public From: andy billimore Subject: problems using classwide types Date: 1997/06/25 Message-ID: <33B10EF3.72B4@dcs.gla.NOSPAM.ac.uk>#1/1 X-Deja-AN: 252459304 Organization: Dept. Computing Science, University of Glasgow Newsgroups: comp.lang.ada Date: 1997-06-25T00:00:00+00:00 List-Id: I'm looking for some help with classwide types. I have defined a parent type - type Transaction_Type is tagged private; And a classwide access type to objects of Transaction_Type'Class - type Transaction_Ptr_Type is access all Transaction_Type'Class; I have then defined a child class, Transactions.Checks - 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; TP : Transaction_Ptr_Type; begin TP := new Check_Type; TP := L_Check; -- Error (see below) end Main; Compiling this produces the following output - main.adb:24:10: expected type "Transaction_Ptr_Type" defined at transactions.ads:5 main.adb:24:10: found private type "Check_Type" defined at transactions-checks.ads:2 gnatmake: "main.adb" compilation error So I can allocate enough memory to hold an object of Check_Type, but I can't assign anything to it which I don't understand. Andrew