comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.cygnus.argh.org>
Subject: Subtype of limited type non-limited?
Date: 2000/03/24
Date: 2000-03-24T08:58:45+00:00	[thread overview]
Message-ID: <87em90iw1n.fsf@deneb.cygnus.argh.org> (raw)

The following code results in a GNAT error message:

access_discriminant.ads:21:36: access discriminants allowed 
                               only for limited types

GNAT assumes that the subtype of a limited type is non-limited (at
least under these special circumstances).  Is this really correct?

with Ada.Streams;

package Access_Discriminant is

   subtype Root_Stream_Type is Ada.Streams.Root_Stream_Type;

   type Read_Write is new Root_Stream_Type with null record;
   --  The following works:
   --  type Read_Write is new Ada.Streams.Root_Stream_Type with null record;

   procedure Read
     (Stream : in out Read_Write;
      Item   : out    Ada.Streams.Stream_Element_Array;
      Last   : out    Ada.Streams.Stream_Element_Offset);
   procedure Write
     (Stream : in out Read_Write;
      Item   : in     Ada.Streams.Stream_Element_Array);

   type Message_Sender is null record;

   type Mail_Body_Stream (Sender : access Message_Sender)
   is new Read_Write with null record;

end Access_Discriminant;




             reply	other threads:[~2000-03-24  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-24  0:00 Florian Weimer [this message]
2000-03-24  0:00 ` Subtype of limited type non-limited? Tucker Taft
replies disabled

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