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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9ce1286476fdb62a,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-20 06:17:38 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!gw1.att.com!fnnews.fnal.gov!uwm.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!news.sprintlink.net!pipex!uunet!world!bobduff From: bobduff@world.std.com (Robert A Duff) Subject: Re: Limited_Controlled types and generic formal parameters Message-ID: Keywords: Ada, generic, limited_controlled, initialize, finalize Organization: The World Public Access UNIX, Brookline, MA References: Date: Fri, 20 Jan 1995 14:17:38 GMT Date: 1995-01-20T14:17:38+00:00 List-Id: In article , Guy L. Oliver 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