comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Dynamically tagged expression not allowed. Why?
Date: Thu, 3 Jun 2010 09:03:38 -0700 (PDT)
Date: 2010-06-03T09:03:38-07:00	[thread overview]
Message-ID: <00c10991-f7f5-4b52-95d3-33772313d507@11g2000prw.googlegroups.com> (raw)
In-Reply-To: op.vdpdimfiule2fv@garhos

On Jun 2, 7:36 pm, Yannick Duchêne (Hibou57)
<yannick_duch...@yahoo.fr> wrote:
> Le Wed, 02 Jun 2010 01:36:17 +0200, Randy Brukardt <ra...@rrsoftware.com>  
> a écrit:> You have to explicitly use a
> > type conversion here:
>
> >     Conn : Class_Type := Class_Type (New_Class_Instance);
>
> This one is not legal, as Class_Type is limited and conversion are not  
> allowed on limited type due to their copy based semantic.
> [ARM 2005 4.6] says about type conversions
> “Neither the target type nor the operand type shall be limited”

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



  parent reply	other threads:[~2010-06-03 16:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-29 17:36 Dynamically tagged expression not allowed. Why? Marc A. Criley
2010-05-29 18:23 ` Dmitry A. Kazakov
2010-06-03  2:37   ` Yannick Duchêne (Hibou57)
2010-06-03  7:48     ` Dmitry A. Kazakov
2010-06-01 23:36 ` Randy Brukardt
2010-06-03  2:36   ` Yannick Duchêne (Hibou57)
2010-06-03  7:57     ` Dmitry A. Kazakov
2010-06-03  8:21       ` Yannick Duchêne (Hibou57)
2010-06-03 16:03     ` Adam Beneschan [this message]
2010-06-05 18:47   ` Marc A. Criley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox