comp.lang.ada
 help / color / mirror / Atom feed
* Extended Type With Discriminant
@ 2001-09-24 18:10 ANH_VO
  2001-09-25 11:01 ` John McCabe
  0 siblings, 1 reply; 2+ messages in thread
From: ANH_VO @ 2001-09-24 18:10 UTC (permalink / raw)
  To: comp.lang.ada

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;





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

* Re: Extended Type With Discriminant
  2001-09-24 18:10 Extended Type With Discriminant ANH_VO
@ 2001-09-25 11:01 ` John McCabe
  0 siblings, 0 replies; 2+ messages in thread
From: John McCabe @ 2001-09-25 11:01 UTC (permalink / raw)


On Mon, 24 Sep 2001 13:10:10 -0500, ANH_VO@udlp.com wrote:

>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.

Although I can't remember the exact details, I think I have seen this
problem before. Of 4 compilers I tried, ObjectAda, APEX, Green Hills
and GNAT, GNAT happened to be the only one that handled this issue
correctly.

If you speak to Rational, you should find that the problem is reported
as a bug in Rational Rose (98i) and should have been passed on to the
version of APEX that was current at the time.

John



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

end of thread, other threads:[~2001-09-25 11:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-24 18:10 Extended Type With Discriminant ANH_VO
2001-09-25 11:01 ` John McCabe

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