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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4b758210c0900d03 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!u19g2000prh.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Protected object which never get finalized Date: Mon, 15 Feb 2010 12:44:13 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1266266653 8542 127.0.0.1 (15 Feb 2010 20:44:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 15 Feb 2010 20:44:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u19g2000prh.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9254 Date: 2010-02-15T12:44:13-08:00 List-Id: On Feb 15, 12:23=A0pm, "John B. Matthews" wrote: > In article , > =A0Hibou57 (Yannick Duch=EAne) wrote: > > > > > > > Le Sun, 14 Feb 2010 13:35:47 +0100, John B. Matthews =A0 > > a =E9crit: > > > Type A_Type has its own private part, and this seems more comparable = to > > > the declaration of protected type B_Type. Is there any reason to make > > > A_Type more opaque? > > > Well, let say first I don't like the idea of designing with a > > compiler bug =A0is mind, and secondly, this is not to be part of a > > public part (I don't =A0really like private stuff in public part). When > > I know a mostly clean workaround, that's Ok, but I do not like this =A0 > > one. > > TBH, as was trying (as explained in the initial post), to workaround = =A0 > > another bug when I meet this one. The interesting point to me, is > > that you get the same, so it is not just =A0my compiler. This means for > > me I should report the bug to AdaCore (as you =A0seem to have confirmed > > the bug). > > I wish I could claim to understand it well enough to say one way or the > other. Given the desired declaration, > > =A0 =A0 package P is > =A0 =A0 =A0 =A0type A_Type is limited private; > =A0 =A0 private > =A0 =A0 =A0 =A0protected type A_Type is > =A0 =A0 =A0 =A0private > =A0 =A0 =A0 =A0 =A0 Spy : Spies.Instance_Type > =A0 =A0 =A0 =A0 =A0 =A0 (Client_Name =3D> new String'("P.A_Type")); > =A0 =A0 =A0 =A0end; > =A0 =A0 end P; > > is "protected type A_Type" a valid completion of "type A_Type is limited > private;" or is that irrelevant? Yes, it's a valid completion. For finalization, it doesn't matter whether a type is private or not. The finalizations that need to be performed on an object need to be done regardless of whether the full view of the type is visible at any particular point. So if finalization takes place as expected when the protected type is public, but doesn't take place when it's private, that's a clear indication that the compiler has blown it. -- Adam