comp.lang.ada
 help / color / mirror / Atom feed
From: ANH_VO@udlp.com
To: comp.lang.ada@ada.eu.org
Subject: Extended Type With Discriminant
Date: Mon, 24 Sep 2001 13:10:10 -0500
Date: 2001-09-24T13:10:10-05:00	[thread overview]
Message-ID: <mailman.1001363848.27511.comp.lang.ada@ada.eu.org> (raw)

GNAT 3.13p on Windows 95 threw an error message of 
"base-standard_io-discrete_in.ads:20:40: full view must inherit discriminants
 of the parent type used in the private extension" for the codes below. I
believe the codes are fine. In fact, the compiled fine under ObjectAda and APEX.
However, I could be wrong since I have been before. Therefore, I would like to
see additional confirmation before reporting it.

with Ada.Finalization;

package Base is

   package Attribute is

      Invalid_Attribute : exception;
      Invalid_Object : exception;

      type Object is abstract tagged null record;
      type Class_Object_Access is access all Object'Class;
      type Constant_Class_Object_Access is access constant Object'Class;

      procedure Set_Attribute (This : in out Object;
                               Attribute_Name : in String;
                               Value : in String) is abstract;

      procedure Validate (This : in Object) is abstract;

   end Attribute;

   type Object (Attributes : Attribute.Constant_Class_Object_Access) is
         abstract new Ada.Finalization.Limited_Controlled with null record;
   type Object_Access is access all Object;
   type Class_Object_Access is access all Object'Class;

private
   Package_Id : constant String := "Base";
   
end Base;


generic
   type Base_Type (<>) is abstract new Base.Object with private;
   
package Base.Attach_To_Service is

   type Object is abstract new Base_Type with
      record
        Event : String (1 .. 3);
      end record;

   procedure Initialize (This : in out Object);

   procedure Finalize (This : in out Object);


   package Attach_Wait is

      type Object is abstract new Attach_To_Service.Object with
         record
            Consumer_Handle : Integer;
         end record;

      -- operation declaration section
      
    end Attach_Wait;

end Base.Attach_To_Service;


with Base.Attach_To_Service;

package Base.Standard_Io.Discrete_In is

   package Event_Mix_In is new Base.Attach_To_Service
                                 (Base.Standard_Io.Object);

   type Object is abstract new Event_Mix_In.Attach_Wait.Object with private;
   type Object_Access is access all Object;
   type Class_Object_Access is access all Object'Class;

private

   package Extended is
      type Object is abstract new 
                       Event_Mix_In.Attach_Wait.Object with null record;
      -- operation declaration section
   end Extended;

   type Object is abstract new Extended.Object with null record;

end Base.Standard_Io.Discrete_In;





             reply	other threads:[~2001-09-24 18:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-24 18:10 ANH_VO [this message]
2001-09-25 11:01 ` Extended Type With Discriminant John McCabe
replies disabled

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