From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48484d95b03e1d36 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-31 03:01:35 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: keld.nielsen@agip.it (Keld Lund Nielsen) Newsgroups: comp.lang.ada Subject: Re: Visibility problems in Parent.Child configuration Date: 31 Jul 2002 03:01:34 -0700 Organization: http://groups.google.com/ Message-ID: <383f908a.0207310201.207dc9ef@posting.google.com> References: <383f908a.0207300341.1047c075@posting.google.com> NNTP-Posting-Host: 151.96.0.8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1028109694 8218 127.0.0.1 (31 Jul 2002 10:01:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 31 Jul 2002 10:01:34 GMT Xref: archiver1.google.com comp.lang.ada:27513 Date: 2002-07-31T10:01:34+00:00 List-Id: You are right. Here is an edited example, which compile except for the last file "unit_test.math.G_scalar.adb". The structure is: Math.ads (compiles) \ Math.G_Scalar.ads (compiles) and Unit_Test.ads (compiles) \ Unit_Test.Math.ads & Unit_Test.Math.adb (compiles) \ Unit_Test.Math.G_Scalar.ads (compiles) & Unit_Test.Math.G_Scalar (comp.error) --Example: ------------------------------ -- Math.ads ------------------------------ with Ada.Numerics.Generic_Elementary_Functions; package Math is package Float_32 is type Instance is digits 6; for Instance'Size use 32; package Operations is new Ada.Numerics.Generic_Elementary_Functions( Instance ); end Float_32; package Float_64 is type Instance is digits 15; for Instance'Size use 64; package Operations is new Ada.Numerics.Generic_Elementary_Functions( Instance ); end Float_64; end Math; ------------------------------ -- Math.G_Scalar.ads ------------------------------ generic type Scalar_Type is private; package Math.G_Scalar is subtype Instance is Scalar_Type; end Math.G_Scalar; --- -- unit test --- package Unit_Test is procedure Write_Test( Result : in Boolean; Routine_Name : in String; Name_Of_Package : in String); end Unit_Test; ------------------------------ -- Unit_Test.Math.ads ------------------------------ package Unit_Test.Math is procedure Check; end Unit_Test.Math; ------------------------------ -- Unit_Test.Math.adb ------------------------------ with Math; use Math; package body Unit_Test.Math is procedure Check is Name_Of_Package: constant String := "Math"; Xs : Float_32.Instance; Xd : Float_64.Instance; begin -- Check Write_Test( (Xs'Size = 32), "Float_32 size", Name_Of_Package); Write_Test( (Xd'Size = 64), "Float_64 size", Name_Of_Package); end Check; end Unit_Test.Math; ------------------------------ -- Unit_Test.Math.G_Scalar.ads ------------------------------ package Unit_Test.Math.G_Scalar is procedure Check; end Unit_Test.Math.G_Scalar; ------------------------------ -- Unit_Test.Math.G_Scalar.adb ------------------------------ with Math.G_Scalar; package body Unit_Test.Math.G_Scalar is procedure Check is Name_Of_Package: constant String := "Math.G_Scalar"; subtype F64 is Math.Float_64.Instance; ------> ERROR HERE package Scalar is new Math.G_Scalar( Math.Float_64.Instance ); ------> ERROR HERE begin -- Check Write_Test( false, "Insert routine name here", Name_Of_Package); end Check; end Unit_Test.Math.G_Scalar; Error message is simply that Float_64 is not in Math according to the compiler(Gnat). Do you have any suggestions? Cheers Keld Robert A Duff wrote in message news:... > I think you have to show us the exact code that gets the error. > I can't see what the problem is from the description below.