comp.lang.ada
 help / color / mirror / Atom feed
* Problem with Ada 95 inheritance and GNAT
@ 2000-04-18  0:00 fabien_bousquet
  0 siblings, 0 replies; only message in thread
From: fabien_bousquet @ 2000-04-18  0:00 UTC (permalink / raw)


I am a novice in Ada 95.
I am trying to use inheritance with Ada 95.
I have written some programs which are compiling well with an
evaluation version of ObjectAda 7.1.
These programs do not compile with GNAT 3.12p on Windows NT.
Below this line there is two small examples which are not compiling
with GNAT.
First example :
GrandParent.ads
package GrandParent is
    type T_GrandParent(size : Positive) is tagged private;

private
   type T_GrandParent(size : Positive) is tagged null record;

end GrandParent;

Parent.ads
with GrandParent;

package Parent is
    type T_GrandParent3 is new GrandParent.T_GrandParent(3) with null
record;

    type T_Parent is new T_GrandParent3 with private;

private
   type T_Parent is new T_GrandParent3 with null record;

end Parent;
During Parent.ads compilation, GNAT returns the error message : "Parent
subtype of full type must be unconstrained".

Second example :
GrandParent.ads
idem eg 1

Parent.ads
with GrandParent;

package Parent is
    type T_Parent is new GrandParent.T_GrandParent(3) with private;

private
   type T_Parent is new GrandParent.T_GrandParent(3) with null record;

end Parent;

Child.ads
with Parent;

package Child is

    type T_Child is new Parent.T_Parent with private;

private
    type T_Child is new Parent.T_Parent with null record;

end Child;
During Child.ads compilation, GNAT returns the error message : "Parent
of full type must descend from parent of private extension".

Could you help me please ?

      Fabien Bousquet


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-04-18  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-18  0:00 Problem with Ada 95 inheritance and GNAT fabien_bousquet

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