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,f5fe096935d4de21,start X-Google-Attributes: gid103376,public From: Dale Stanbrough Subject: argument of conversion cannot be an allocator Date: 1997/05/14 Message-ID: <5lbccj$7vk$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 241470522 Distribution: world X-XXMessage-ID: Organization: Royal Melbourne Institute of Technology Newsgroups: comp.lang.ada Date: 1997-05-14T00:00:00+00:00 List-Id: I came across the following problem... type a is tagged private; type a_ptr is access all a'class; type b is new a with private; type b_ptr is acces all b'class; ... return a'(new b); which results in the error message (from GNAT) "argument of conversion cannot be an allocator" The work around is... declare temp : b_Ptr := new b; begin return a_ptr(temp); end; I presume there is a good reason for this; can anyone provide enlightenment on this point (or even a simpler way to accomplish the above)? Dale