comp.lang.ada
 help / color / mirror / Atom feed
* Help on extending a private record from a private record with a generic attribute...
@ 1998-04-16  0:00 Christopher Campise
  1998-04-16  0:00 ` Tucker Taft
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Campise @ 1998-04-16  0:00 UTC (permalink / raw)



Ada95 on a Rational Apex compiler:
I have a "superclass" with a private record consisiting of a generic
type attribute.  I need to inherit this from within another package but
am receiving compiler errors stating that "a record extension will be
provided iff the parent record is tagged," (which it is).  Is this even
legal?  I looked everywhere for examples and found none that relate to
this, adahome.com, Programming in Ada95, Rendezvous with Ada95, plus
other tutorials.  Any ideas?

For example:

***********
generic
   type Value_Class is private;

package Generic is
   type Class is tagged private;
         .
         .

private
   type Class is tagged
      record
         Some_Value : Value_Class;
      end record;

end Generic;

***********

with Generic;

package MyPackage is
    type Class is new Generic.Class with private;  -> Message: "CLASS
(2nd one) denotes no component of Generic; a record extension

will be provided iff  parent type is a tagged type" (which it is)
                .
                .
private
   type Class is new Generic.Class with    ->   Message: "CLASS (2nd
one) denotes no component of Generic; a record extension

record
will be provided iff  parent type is a tagged type" (which it is)
         Index : Integer;
      end record;
end MyPackage;
***********

--
Chris Campise, Associate Engineer     phone:  (716)631-0610 x384
Amherst Systems Inc.                         fax:    (716)631-0629
30 Wilson Road                                 E-Mail: crc@amherst.com
Buffalo, NY 14221                            WWW: www.amherst.com






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-04-17  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-16  0:00 Help on extending a private record from a private record with a generic attribute Christopher Campise
1998-04-16  0:00 ` Tucker Taft
1998-04-17  0:00   ` Assistance " Anonymous
1998-04-17  0:00     ` Christopher Campise
1998-04-17  0:00     ` Tucker Taft

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