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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,33ed4ca582c945fc X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!m44g2000hsc.googlegroups.com!not-for-mail From: fedya_fedyakoff@inbox.ru Newsgroups: comp.lang.ada Subject: Re: Limited returns Date: Mon, 23 Jun 2008 08:04:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: <304d62f5-53eb-4ec2-bcd5-a84ac8f9fe60@m44g2000hsc.googlegroups.com> References: NNTP-Posting-Host: 81.25.167.50 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1214233474 301 127.0.0.1 (23 Jun 2008 15:04:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 23 Jun 2008 15:04:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m44g2000hsc.googlegroups.com; posting-host=81.25.167.50; posting-account=ESyqEgoAAAB5AfqBmmLVjrqeNSkFQsKY User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.50 (Windows NT 5.1; U; ru),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:818 Date: 2008-06-23T08:04:33-07:00 List-Id: Hehe, and let's consider this: with Ada.Finalization; procedure Test_Limited_Stuff is type E is ( Make_S, Make_S1 ); type I is interface; type T is new Ada.Finalization.Controlled with record A : Integer; end record; type S is new T and I with record --Self : not null access S'Class := S'Unchecked_Access; B: Integer; end record; type S1 is new T and I with record --Self : not null access S1'Class := S1'Unchecked_Access; N: String(1..256); end record; function Factory( w: E ) return I'Class is begin if w = Make_S then return S'(Ada.Finalization.Controlled with A => 0, B => 1); else return S1'(Ada.Finalization.Controlled with A => 0, N => (others => 10) ); end if; end Factory; Value : I'Class := Factory(Make_S); begin Value := Factory(Make_S1); end Test_Limited_Stuff; Crashed pretty badly with CONSTRAINT_ERROR, whining about tag check error. Seems its completely buggy and unusable.