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,e859f774bbb3dfb3 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!8g2000hse.googlegroups.com!not-for-mail From: fedya_fedyakoff@inbox.ru Newsgroups: comp.lang.ada Subject: Re: another way to shoot yourself in the foot? Date: Fri, 20 Jun 2008 02:48:57 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <54157920-377a-441b-9b0b-f0c4f9ddffec@f36g2000hsa.googlegroups.com> <15z8wo6iewt2j.174nhbzom2i0t.dlg@40tude.net> NNTP-Posting-Host: 81.25.167.50 Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1213955337 24962 127.0.0.1 (20 Jun 2008 09:48:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 20 Jun 2008 09:48:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 8g2000hse.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:774 Date: 2008-06-20T02:48:57-07:00 List-Id: On 20 =C9=C0=CE, 13:34, "Dmitry A. Kazakov" wrote: > On Fri, 20 Jun 2008 02:03:32 -0700 (PDT), fedya_fedyak...@inbox.ru wrote: > > Consider a very simple code. Suppose we have > [...] > > I have an idea why the program behavs like that, but i think there > > must be some warning at least. > > > What do you think? > > This looks like a compiler bug to me. It seems that the compiler > prematurely finalizes the object created by the factory, as if the object > were non-limited. Because the object is nevertheless somewhat limited thi= s > finalization happens in-place, on a living object... (:-)) > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Strangely, replacing 'aNamed1: Named.Object'Class :=3D Factory.Create("Some", "Two");' with 'aNamed1: Some.Object'Class :=3D Some.Create("Two");' leads program to run perfectly ... I thought it's some type of narrowing problem ... but anyway you're right, it seems very match as compiler bug...