comp.lang.ada
 help / color / mirror / Atom feed
From: Mart van de Wege <mvdwege@gmail.com>
Subject: Re: Can't access record attribute in derived type
Date: Wed, 08 Mar 2017 22:06:12 +0100
Date: 2017-03-08T22:06:12+01:00	[thread overview]
Message-ID: <86a88v4gxn.fsf@gaheris.avalon.lan> (raw)
In-Reply-To: o9pob6$ogc$1@franka.jacob-sparre.dk

"Randy Brukardt" <randy@rrsoftware.com> writes:

> I suspect we'll need to see a more complete example to definitively say what 
> the problem is.
>
> But if I had to guess, I'd suggest that you've run afoul of the "sibling 
> inheritance problem". The rule for visibility for child components is that 
> *all* of components of the *all* of the ancestors have to be visible at the 
> point of declaration of the child type. If even one of the ancestors is not 
> visible (as happens when deriving from a type defined in a sibling child 
> package), then the components aren't visible, either.
>
> Note that in such a case, if you have visiblity on some but not all of the 
> ancestors, you can type convert the object to make them visible. In your 
> example above:
>
>      return Creature(K).Parents.First_Element;
>
> will work if you have some intermediate ancestor without visible components. 
> So, if the above works, you have a sibling inheritance problem, and your 
> choices are either to use conversions like the above, or move the types so 
> that all of the ancestors are visible.
>
>                                      Randy.
>
>
>

-- 
"We will need a longer wall when the revolution comes."
    --- AJS, quoting an uncertain source.


  reply	other threads:[~2017-03-08 21:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 14:15 Can't access record attribute in derived type Mart van de Wege
2017-03-08 14:24 ` G.B.
2017-03-08 15:06   ` Mart van de Wege
2017-03-08 19:30     ` Niklas Holsti
2017-03-08 21:05       ` Mart van de Wege
2017-03-08 20:08 ` Randy Brukardt
2017-03-08 21:06   ` Mart van de Wege [this message]
2017-03-08 21:12   ` Mart van de Wege
2017-03-08 21:25     ` Mart van de Wege
2017-03-08 21:50       ` Simon Wright
2017-03-08 22:35         ` Mart van de Wege
2017-03-08 21:03 ` Shark8
2017-03-08 21:16   ` Mart van de Wege
replies disabled

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