comp.lang.ada
 help / color / mirror / Atom feed
From: stt@henning.camb.inmet.com (Tucker Taft)
Subject: Re: Primitive Operations Question
Date: 1996/07/31
Date: 1996-07-31T00:00:00+00:00	[thread overview]
Message-ID: <DvEwtE.3Gz.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 31FE812C.7B3D@ix.netcom.com


Vance Christiaanse (cintech@ix.netcom.com) wrote:


: Much to my dismay, the following procedure compiles on the WebAda
: (GNAT 3.04) compiler.  By my reading of RM95 3.2.3, A and B don't
: fit any part of the definition of primitive operations, so I
: don't see why iheritance seems to be occurring.  When I replace
: all three types with a hierarchy of tagged types, both calls
: fail to compile, as I would have expected.

: Any insight would be much appreciated.

Your reading is correct; GNAT must have a bug in this area.

Our AdaMagic front end flags both procedure calls as being in error
(see below).

: Thanks,

: Vance Christiaanse
: Cintech Consulting
: cintech@ix.netcom.com

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Cambridge, MA  USA
--------------------

: procedure Example is

:   type My_Digit is range 0..7;
:   procedure A (V : My_Digit);

:   type New_Digit is new My_Digit;  -- is A inherited???

:   procedure B (W : New_Digit);

:   N : New_Digit := 1;

:   type Newer_Digit is new New_Digit;  -- is B inherited???

:   M : Newer_Digit := 1;

:   procedure A (V : My_Digit) is
:   begin
:     null;
:   end A;

:   procedure B (W : New_Digit) is
:   begin
:     null;
:   end B;

: begin

:    A(N);

:    B(M);

: end Example;

-------------------- Output from AdaMagic(tm) ---------------

Source file: primprob.ada   Wed Jul 31 10:35:14 1996

  ...

   50 begin
   51 
   52    A(N);
         *
*****Error: LRM:6.4.1(3) Parameter mismatch in call, continuing
   53 
   54    B(M);
         *
*****Error: LRM:6.4.1(3) Parameter mismatch in call, continuing
   55 

 ...





  parent reply	other threads:[~1996-07-31  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-30  0:00 Primitive Operations Question Vance Christiaanse
1996-07-31  0:00 ` Samuel Tardieu
1996-07-31  0:00 ` Tucker Taft [this message]
1996-07-31  0:00 ` Jon S Anthony
1996-07-31  0:00 ` Robert A Duff
1996-07-31  0:00   ` Vance Christiaanse
1996-08-01  0:00     ` Robert A Duff
1996-08-01  0:00       ` Vance Christiaanse
1996-08-01  0:00 ` Jon S Anthony
1996-08-01  0:00   ` Robert A Duff
replies disabled

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