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.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,381b38831db17ac9,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-22 11:20:40 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!wn1feed!wn4feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi_feed3!attbi.com!rwcrnsc52.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada Subject: Who is wrong, me or GNAT? :-) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: NNTP-Posting-Host: 12.224.45.159 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc52 1009048840 12.224.45.159 (Sat, 22 Dec 2001 19:20:40 GMT) NNTP-Posting-Date: Sat, 22 Dec 2001 19:20:40 GMT Organization: AT&T Broadband Date: Sat, 22 Dec 2001 19:20:40 GMT Xref: archiver1.google.com comp.lang.ada:18248 Date: 2001-12-22T19:20:40+00:00 List-Id: OK, here's the code: -------------------------------------------- -- foo.adb -------------------------------------------- procedure Foo is package P is type T is abstract tagged null record; function Create return T is abstract; end P; package P1 is type T2 is new P.T with private; private type T1 is new P.T with null record; function Create return T1; type T2 is new T1 with null record; -- -- Gnat takes error on this ^^^ line. -- -- But T2 should inherit 'Create' from -- (concrete) type T1. end P1; package body P1 is function Create return T1 is begin return (null record); end Create; end P1; begin null; end Foo; ---------------------------------------- GNAT 3.13(p) says: foo.adb:16:30: type must be declared abstract or "Create" overridden Is this a bug in GNAT? If not, what am I missing? I was trying to come up with an idiom for inherited constructors for descendants of an abstract tagged type, and this seemed like it ought to do the trick (although it suffers from the fact that the intermediate derived type, e.g. T1 in this case, would have to override all the abstract primitives). Any help appreciated... thx -- mark