comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: Heterogenous_Array_Test: please explain error
Date: Tue, 12 Jun 2001 19:50:47 GMT
Date: 2001-06-12T19:50:47+00:00	[thread overview]
Message-ID: <rouV6.5701$pb1.221839@www.newsranger.com> (raw)
In-Reply-To: mailman.992374395.5423.comp.lang.ada@ada.eu.org

In article <mailman.992374395.5423.comp.lang.ada@ada.eu.org>, M. A. Alves
says...
>
>Isn't this the 'standard' way of implementing an heterogenous array?
>Why is it not working?  Please explain the compiler's error on the last
>statement.  Thanks.
>  Item(2).Child_Component := 22;
>    -- error: no selector "Child_Component" for type "Root'Class"

The problem is pretty much what the compiler says it is. The type of elements in
your Item array is "Root'Class". That type doesn't have any components named
"Child_Component". If you want to access that component, you have to tell the
compiler that the type is really "Child" (which it will verify at runtime just
to be sure). I think something like the following will work, though I haven't
compiled it:

Child'(Item(2).all).Child_Component := 22;

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



  parent reply	other threads:[~2001-06-12 19:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-12 20:32 Heterogenous_Array_Test: please explain error M. A. Alves
2001-06-12 19:44 ` Ehud Lamm
2001-06-12 19:50 ` Ted Dennison [this message]
2001-06-13  9:52   ` Lutz Donnerhacke
2001-06-13 14:42     ` Ted Dennison
2001-06-13 14:48       ` Ehud Lamm
2001-06-13 15:40         ` Ted Dennison
2001-06-13 17:10           ` Ehud Lamm
replies disabled

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