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: 103376,1be082612b8c5f2e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!postnews.google.com!11g2000prw.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Dynamically tagged expression not allowed. Why? Date: Thu, 3 Jun 2010 09:03:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: <00c10991-f7f5-4b52-95d3-33772313d507@11g2000prw.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1275581019 21861 127.0.0.1 (3 Jun 2010 16:03:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 3 Jun 2010 16:03:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 11g2000prw.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) Xref: g2news1.google.com comp.lang.ada:11256 Date: 2010-06-03T09:03:38-07:00 List-Id: On Jun 2, 7:36=A0pm, Yannick Duch=EAne (Hibou57) wrote: > Le Wed, 02 Jun 2010 01:36:17 +0200, Randy Brukardt = =A0 > a =E9crit:> You have to explicitly use a > > type conversion here: > > > =A0 =A0 Conn : Class_Type :=3D Class_Type (New_Class_Instance); > > This one is not legal, as Class_Type is limited and conversion are not = =A0 > allowed on limited type due to their copy based semantic. > [ARM 2005 4.6] says about type conversions > =93Neither the target type nor the operand type shall be limited=94 Umm, no, that sentence (4.6(24.7)) applies only to array types. (And, I think, only in cases where there is no common ancestor of the operand and target type.) However, 7.5(2.1-2.2) makes it illegal. Type conversions on limited types are allowed in some cases; e.g. if T1 is a limited tagged type, and T2 is a type extension, and X2 is an object of type T2, you can use T1(X2) as an actual parameter to a procedure that takes an IN OUT parameter of type T1. This is a view conversion and doesn't involve a copy. -- Adam