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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,73057f1a3ca11607 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Is T an ancestor of T? Date: Fri, 15 Oct 2004 18:55:22 +0200 Organization: AdaCL Message-ID: <2668948.gJfALsUrHD@linux1.krischik.com> References: <1738418.atIT6LYH9Z@linux1.krischik.com> <1940150.rU8f1KaX3L@linux1.krischik.com> <6577257.BAFHMKqgPc@linux1.krischik.com> <1406724.hY6njLzCIG@linux1.krischik.com> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1097859369 02 29084 AHIRX-zJsd8+MhM 041015 16:56:09 X-Complaints-To: usenet-abuse@t-online.de X-ID: bLbh8BZUQeoKgnRs+Gt3YHHtTAvwHzUjL291MzZJNtF0zAcseP3MrE User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:5279 Date: 2004-10-15T18:55:22+02:00 List-Id: Georg Bauhaus wrote: > Martin Krischik wrote: > > :> 'class as return type of constructor functions creates a number of > :> not-so-nice conversion necessities that I'd like to avoid. > : > : I thought as an example. Not to actually use this constructor pattern. > > Interestingly, GNAT complains if T is derived from some other > type Base. For example, > > function Make return T'Class is > begin > return T'(T with N => 42); > end Make; > > > 7. return T'(T with N => 42); > | > >>> expect ancestor type of "T" > > (Same for specific T.) Well T is not an ancestor of T. T is T itself. You might want try the example with a tagged type which actually has a parent to see the difference. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com