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,da3bc97b715b8d03,start X-Google-Attributes: gid103376,public From: Simon Wright Subject: new type'class'() legal? Date: 1996/12/02 Message-ID: #1/1 X-Deja-AN: 201944114 x-nntp-posting-host: pogner.demon.co.uk sender: simon@pogner organization: At Home newsgroups: comp.lang.ada Date: 1996-12-02T00:00:00+00:00 List-Id: The code below compiles fine on Gnat 3.07, various platforms, but fails on Academic AdaMagic and ObjectAda (the demo version) at the point indicated with "e has no possible interpretation as an expression of the expected type base'class". I hope Gnat is right? (in case you're wondering why I wrote it this way, the original code has derived types ext1, ext2 which are each the root of a tree of derived types, and which have sufficiently different properties that I wanted to make sure that the appropriate proc() was called). -- package classp is type base is tagged null record; type base_p is access base'class; type ext is new base with null record; procedure proc (e : ext'class); end classp; package body classp is p : base_p; procedure proc (e : ext'class) is begin p := new base'class'(e); -------------------------^ end proc; end classp;