From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Limited_Controlled types and generic formal parameters
Date: Fri, 20 Jan 1995 14:17:38 GMT
Date: 1995-01-20T14:17:38+00:00 [thread overview]
Message-ID: <D2pJpE.22v@world.std.com> (raw)
In-Reply-To: goliver.1.000B3230@magnus.acs.ohio-state.edu
In article <goliver.1.000B3230@magnus.acs.ohio-state.edu>,
Guy L. Oliver <goliver@magnus.acs.ohio-state.edu> wrote:
>The problem seems to be that the generic package can not tell that item
>(one of the generic formal parameters) is a derived type of limited
>controlled. When I wrote a test program to see what was being initialized, I
>saw that the item in the box was not being initialized. After consulting the
>AARM, I am nearly certain that it should have.
Sounds like a compiler bug. Every object of a controlled type gets
Initialize called for it. That includes components (components are
objects), and it even includes components whose type is a generic formal
type that isn't visibly controlled.
One exception: when you write an aggregate, this creates a temporary
object, and Initialize is not called for that temp -- when you write an
aggregate, you're asking for certain component values, and you don't
want them modified. Usually, a controlled type will be a private type,
or a private extension, so aggregates are only allowed within the
package itself.
- Bob
next parent reply other threads:[~1995-01-20 14:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <goliver.1.000B3230@magnus.acs.ohio-state.edu>
1995-01-20 14:17 ` Robert A Duff [this message]
1995-01-23 17:28 ` Limited_Controlled types and generic formal parameters Cyrille Comar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox