From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 20 Jan 93 11:03:56 GMT 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.... Message-ID: <1993Jan20.110356.23223@greco-prog.fr> List-Id: 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~