comp.lang.ada
 help / color / mirror / Atom feed
* Question about tagged types and functions
@ 1996-05-21  0:00 David Hunter
  1996-05-22  0:00 ` Laurent Guerby
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Hunter @ 1996-05-21  0:00 UTC (permalink / raw)



Given:

  package Test is

    type BaseType is tagged record
      null;
    end BaseType;

    function Create return BaseType;

    type DerivedType is new BaseType with record
      null;
    end DerivedType;

  end Test;

Why does Ada-95 (GNAT 3.01a) tell me that I also
*must* have:

    function Create return DerivedType;

There is something going on with tagged types
and functions that I don't understand because
if I use

    procedure Create(a : out BaseType);

it (Ada-95) does not object.

===============================================
David Hunter (hunter@mwc.edu)
CPSC Department
Mary Washington College
Fredericksburg, VA 22401





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

end of thread, other threads:[~1996-05-23  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-21  0:00 Question about tagged types and functions David Hunter
1996-05-22  0:00 ` Laurent Guerby
1996-05-22  0:00   ` David Hunter
1996-05-22  0:00 ` Jon S Anthony
1996-05-23  0:00 ` Jon S Anthony

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