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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a7dc5eccc42e4334 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: GNAT: bug or feature? Date: Mon, 15 Mar 2010 17:21:30 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4b9d524a$0$22397$426a74cc@news.free.fr> <587c6500-6de1-4ebf-b7b1-8d3b2949d05b@u9g2000yqb.googlegroups.com> <4b9e927a$0$21789$426a74cc@news.free.fr> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1268688077 21648 192.74.137.71 (15 Mar 2010 21:21:17 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 15 Mar 2010 21:21:17 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:2It4h+1X5G0IN2WjbpYRRJiIsPs= Xref: g2news1.google.com comp.lang.ada:9584 Date: 2010-03-15T17:21:30-04:00 List-Id: Damien Carbonne writes: > Thanks (both of you) for explanations. > Indeed, when no new component is added, it seems possible for the > compiler to automatically generate the required function. Exactly. The compiler generates something like: overriding function Create return Derived is begin return (Base'(Create) with null record); end Create; which just returns the same thing as the Base type's Create, but with the Tag set properly for the Derived type. By the way, you're slightly misusing the term "base" -- that's not what it means in Ada. You could call it Parent. Or Root. A "base subtype" is something else. - Bob