comp.lang.ada
 help / color / mirror / Atom feed
From: Jerome Desquilbet <jDesquilbet@Rational.COM>
Subject: Re: Controlled Types & GNAT 3.09
Date: 1997/03/21
Date: 1997-03-21T00:00:00+00:00	[thread overview]
Message-ID: <3332AD5C.41C6@Rational.COM> (raw)
In-Reply-To: 5gfqro$jru@sutton.cs.columbia.edu


Alexander V. Konstantinou wrote:
> 
> I am forwarding a message sent to me by the GNAT developers.  It 
> appears
> that the GNAT language lawyers believe that the use of Controlled 
> types
> in my example is a valid one.

I still think that your example shouldn't produce this output.

The bug in GNAT has been fixed the wrong way: if Initialize, Adjust and
Finalize are declared in the partial view (where the type is not known
as being Controlled), then the Initialize, Adjust and Finalize you
declare are not the related to the operation with same name in the
Controlled type. 

This is true for any tagged type construction like yours:

For example:


package Base is
    type Object is tagged null record;
    procedure Primitive (A_Base : in Object);
end Base;

with Base;
package Derived is
    type Object is private;
    procedure Primitive (A_Derived : in Object);
private
    type Object is new Base.Object with null record;
end Derived;


Users of Derived DON'T KNOW that Derived.Object is derived from
Base.Object, right
Does GNAT compiles the following with Derived declared as above???


with Base;
with Derived;
procedure Try_Base_And_Derived is
    A_Derived : Derived.Object;
begin
    Base.Primitive (Base.Object'Class (A_Derived));
end Try_Base_And_Derived;


I hope the answer is no...
Why would it be different because you derived from Controlled instead of
some other tagged type???

  Jerome.

______________________________________________________________________
Jerome Desquilbet                             jDesquilbet@Rational.COM
 ' ^




  reply	other threads:[~1997-03-21  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-11  0:00 Controlled Types & GNAT 3.09 Alexander V. Konstantinou
1997-03-13  0:00 ` Robert Dewar
1997-03-14  0:00 ` Pascal Ledru
1997-03-15  0:00   ` Alexander V. Konstantinou
1997-03-21  0:00     ` Jerome Desquilbet [this message]
1997-03-14  0:00 ` Jerome Desquilbet
1997-03-14  0:00   ` Robert A Duff
1997-03-14  0:00     ` Tom Moran
replies disabled

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