From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
Subject: Re: Is T an ancestor of T?
Date: Fri, 15 Oct 2004 17:19:22 +0000 (UTC)
Date: 2004-10-15T17:19:22+00:00 [thread overview]
Message-ID: <ckp0qq$a2l$1@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: 2668948.gJfALsUrHD@linux1.krischik.com
Martin Krischik <krischik@users.sourceforge.net> wrote:
: Georg Bauhaus wrote:
:
:> Martin Krischik <krischik@users.sourceforge.net> 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.
Not in this example where it is derived from another type, named Base.
: T is T itself. You might want try the
: example with a tagged type which actually has a parent to see the
: difference.
This is exactly what I have been doing, the results above are
for a T that is derived from another type, named Base.
In this GNAT spits out this error message. Otherwise it doesn't.
I still don't know whether or not a type is an ancestor of itself,
given that it is a descendant of itself.
-- Georg
next prev parent reply other threads:[~2004-10-15 17:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-12 1:31 record extension aggregate for returned type legal? Georg Bauhaus
2004-10-12 8:04 ` Martin Krischik
2004-10-12 14:36 ` Georg Bauhaus
[not found] ` <1940150.rU8f1KaX3L@linux1.krischik.com>
2004-10-12 20:24 ` Georg Bauhaus
2004-10-13 7:52 ` Martin Krischik
[not found] ` <ckjlhm$2hh$1@a1-hrz.uni-duisburg.de>
[not found] ` <ukhbd.106086$dP1.396181@newsc.telia.net>
2004-10-14 0:29 ` Is T an ancestor of T? Georg Bauhaus
2004-10-14 8:54 ` Is T an ancestor of T? (was: Re: record extension aggregate for returned type legal?) Martin Krischik
[not found] ` <ckot3m$hek$1@a1-hrz.uni-duisburg.de>
2004-10-15 16:55 ` Is T an ancestor of T? Martin Krischik
2004-10-15 17:19 ` Georg Bauhaus [this message]
2004-10-16 14:37 ` Martin Krischik
2004-10-13 16:18 ` record extension aggregate for returned type legal? Jean-Pierre Rosen
[not found] ` <87ekk0hvfq.fsf@beeblebrox.rfc1149.net>
2004-10-15 16:51 ` Martin Krischik
[not found] ` <t7tokc.2he.ln@skymaster>
2004-10-15 17:22 ` Georg Bauhaus
2004-10-14 20:04 ` Simon Wright
-- strict thread matches above, loose matches on Subject: below --
2004-10-18 5:55 Is T an ancestor of T? Christoph Karl Walter Grein
2004-10-20 14:02 ` Georg Bauhaus
2004-10-20 16:18 ` Björn Persson
2004-10-20 21:41 ` Georg Bauhaus
2004-10-20 23:33 ` Björn Persson
2004-10-22 2:27 ` Georg Bauhaus
2004-10-23 16:55 ` Björn Persson
2004-10-26 0:37 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox