comp.lang.ada
 help / color / mirror / Atom feed
From: duncan@thurston.camb.inmet.com (Bruce Duncan)
Subject: Re: Error Instantiating Child (very long)
Date: 1996/08/08
Date: 1996-08-08T00:00:00+00:00	[thread overview]
Message-ID: <DvuEro.D9D.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 4uals1$7s4@blackbird.afit.af.mil


In article <4uals1$7s4@blackbird.afit.af.mil>,
Captain Earl Conrad Pilloud  <epilloud@afit.af.mil> wrote:
>Hi,
>
>I have an application where I need to define a number of child classes
>(representing different attributes)
>which are only slighly different from the parent class (Attribute).
>
>I defined a tagged type which represents the parent.
>(WW.Attribute.Object)
>In a child package, I defined a generic package for the child class.
>(WW.Attribute.Child)
>
>My problem is that when I try to instantiate the generic child,
>the parent class attributes are no longer visible.
>
>package WW.Attribute.Sample is new Attribute.Child(
>  Attribute_ID   => 3, 
>  Attribute_Name => WW.Types.String16.To_Bounded_String("Sample"),
>  T              => WW.Types.Vector_32, 
>  T_Ptr          => WW.Types.Vector_32_Ref);
>  
>
>(This works if I make the child class non-generic, but I really don't
>want to make .ads and .adb files for every different kind of child
>class--that's what generics are for)
>
>What's My Problem???? 

This looks like a compiler bug.

Our AdaMagic compiler says it's OK (well, with one unrelated
fix... see below).

>Thanks In Advance,
>Conrad
>
>  Source Code Follows Below....
>
>(I'm compiling on the SGI using GNAT 3.04w with gcc 2.7.2)

You should send this along to report@gnat.com to let them know of the
problem.

The other problem that the AdaMagic compiler found was that both of
your Delete routines need an explicit conversion from the anonymous
access type:

>   procedure Delete(Instance : access Object)is
>
>      Dummy_Pointer : Delete_Object_Pointer := Instance;

Should be:

  procedure Delete(Instance : access Object)is

     Dummy_Pointer : Delete_Object_Pointer := Delete_Object_Pointer(Instance);


If GNAT doesn't catch this then you should also report that as a bug.

-- Bruce Duncan (duncan@inmet.com)
-- Intermetrics, Inc.




      reply	other threads:[~1996-08-08  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-07  0:00 Error Instantiating Child (very long) Captain Earl Conrad Pilloud
1996-08-08  0:00 ` Bruce Duncan [this message]
replies disabled

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