comp.lang.ada
 help / color / mirror / Atom feed
From: enterpoop.mit.edu!eru.mt.luth.se!kth.se!sunic!mcsun!julienas!corton!geocu b!goofi!houillon@ucbvax.Berkeley.EDU  (Christian Houillon alias Colt)
Subject: SOS find the bug....
Date: 20 Jan 93 11:03:56 GMT	[thread overview]
Message-ID: <1993Jan20.110356.23223@greco-prog.fr> (raw)

Hi.

I am meeting a problem with ADA compilation for which we don't know the clue.
Could you help me to solve it ?

Here the specifications....

generic

	type	LABEL1 is limited private ;
	type	TO_LABEL2 is limited private ;
	type	TO_LABEL3 is limited private ;
	

package PACK1 is

-- =====================================================
	generic
	      type LABEL2 is limited private ;
		
	package PACK2 is
-- =====================================================
	      	generic
			type LABEL3 is limited private ;

		package PACK3 is
			type RECORD3 is limited private ;
			procedure PROC3 ( In_Record3 : in RECORD3 ) ;

		private
			type RECORD3 is record
			     LAB3 : LABEL3 ;
		       end record ;

		end PACK3 ;			

-- =====================================================
						
         package PACK3_INST is new PACK3 ( LABEL3 => TO_LABEL3 ) ;
	 use PACK3_INST ;

	 type RECORD2 is limited private ;

	 procedure PROC2 ( In_Record2 : in RECORD2 ;
	       	       	   In_Record3 : in RECORD3 ) ;

	 private

	 	type RECORD2 is record
		     LAB2 : LABEL2 ;
		     REC3 : RECORD3 ;
		end record ;

	 end PACK2 ;
-- ======================================================

   	package PACK2_INST is new PACK2 ( LABEL2 => TO_LABEL2 ) ;

	use PACK2_INST ;	--  the problem must be here
	use PACK3_INST ;	--  ... why ????
	
	type RECORD1 is limited private ;

	procedure PROC1 ( In_Record1 : in RECORD1 ) ;

	private
		type RECORD1 is record
		     LAB1 : LABEL1 ;
		     REC2 : RECORD2 ;
		end record ;

end PACK1 ;

.............................................................................
...... and the body

package body PACK1 is

	package body PACK2 is

		package body PACK3 is 

		procedure PROC3 ( In_Record3 : in RECORD3 ) is
		begin
			null ;
	        end PROC3 ;

		end PACK3 ;

-- if I don't use the expression
--     procedure PROC2 ( In_Record2: in RECORD2 ;
--    	                 In_Record3: in PACK3_INST.RECORD3 ) is
-- I get a compilation error message (see below)
--

        procedure PROC2 ( In_Record2: in RECORD2 ;
	      	      	  In_Record3: in RECORD3 ) is
	begin
		null ;
	end PROC2 ;

	end PACK2 ;

procedure PROC1 ( In_Record1 : in RECORD1 ) is
begin
	null ;
end PROC1 ;

end PACK1 ;
	  

...............................................................................
.... finally the error message ....

  14:        procedure PROC2 ( In_Record2: in RECORD2 ;
  15:	      	      	  In_Record3: in RECORD3 ) is
A -------------------------------------^
A:error: RM 8.3: identifier undefined
A:error: RM 8.4(6): Potentially visible declarations cancel:
A:error: 	record3, line 28 in pack3 from file /u3/houillon/PROJETS/ADA/GR
APHES/PACK_GRAPH/bug-ads.a
A:error: 	record3, line 28 in pack3 from file /u3/houillon/PROJETS/ADA/GR
APHES/PACK_GRAPH/bug-ads.a


OK it's a *little bit* tricky, but I'd like to understand where's the problem.

Thanx a lot for your answers.

					a puzzled ADA novice

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So if you want my address, it's number one at the end of the bar,
where I sit with the broken angels, clutching at straws and nursing our scars.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

             reply	other threads:[~1993-01-20 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-01-20 11:03 enterpoop.mit.edu!eru.mt.luth.se!kth.se!sunic!mcsun!julienas!corton!geocu [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-01-22  0:38 SOS find the bug Pascal Obry
replies disabled

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