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!news1.google.com!news.glorb.com!news.zanker.org!newsfeed00.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: record extension aggregate for returned type legal? Date: Wed, 13 Oct 2004 09:52:46 +0200 Organization: AdaCL Message-ID: <6577257.BAFHMKqgPc@linux1.krischik.com> References: <1738418.atIT6LYH9Z@linux1.krischik.com> <1940150.rU8f1KaX3L@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 1097654855 01 2299 3a5oXxeOI0BIHUu 041013 08:07:35 X-Complaints-To: usenet-abuse@t-online.de X-ID: VOLGDcZdreQt+9t3CA5X8hAo8ZGvBJ1wPSlmgF9Q8BQxpWg7gFoUUk User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:5135 Date: 2004-10-13T09:52:46+02:00 List-Id: Georg Bauhaus wrote: > Martin Krischik wrote: > : T' (spoken T kick) tells the compiler that the next expression is of > : type T. i.E: Positive'(1) means that you want a Positive and not an > : Integer. If you won't say anything the compiler will choose automaticly. > > In this case T is specific, and `make` is not a primitive operation > of T (because make is in child package B). So does the compiler > have a choice at all? > > LRM 4.3.2, quoted in one compiler's error message, says, > > 4. The expected type for an extension_aggregate shall be a single > nonlimited type that is a record extension. If the ancestor_part > is an expression, it is expected to be of any nonlimited tagged > type. > > Do I understand this phrase? The expected type in the return expression > for "function make return T" is the specific tagged type T. > In "return (n => 0)", there is no extension aggregate. > In "return (T with n => 0)", there is an extension aggregate, > the ancestor part being T. But T in your example is a root class and therefore has no ancestor. T needs an standart aggregate and not an extension aggregate. > T is not limited. > T is not an extension (a record extension?). > Does T have an ancestor (does T maybe count as an ancestor of T here?) Consider the other constructor pattern: type P is abstract tagged private; type C is new P with private; function Create returns P'Class; function Create returns P'Class is begin return C'(P with ...); end Create With Regards. Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com