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=-0.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3dfbe7efea6ccdfa,start X-Google-Attributes: gid103376,public From: 100331.2264@compuserve.com (R.J. Kirkbride) Subject: ADA 95/Gnat Problem? Date: 1996/04/11 Message-ID: <4kjakg$htv@dub-news-svc-1.compuserve.com>#1/1 X-Deja-AN: 146936980 organization: CompuServe Incorporated newsgroups: comp.lang.ada Date: 1996-04-11T00:00:00+00:00 List-Id: Does anyone know why the code at the end produces the following error message? It works under an Ada 83 compiler fine so I am not sure whether this is an Ada 95 issue or Gnat. Any help would be greatly appreciated, Rob. GNU Ada version 2.7.2 (80386, BSD syntax) compiled by GNU C version 2.7.0. enabled: -fpeephole -ffunction-cse -freg-struct-return -fcommon -fgnu-linker -m80387 -mhard-float -mno-soft-float -mno-386 -m486 -mieee-fp -mfp-ret-in-387 bug.adb:14:08: expected private type "Set" defined at generic_bounded_ordered_set.ads:9 bug.adb:14:08: found private type "Set" defined at generic_bounded_ordered_set.ads:9 with Text_Io; with Generic_Bounded_Ordered_Set; procedure Bug is package Test_Bounded_Ordered_Set is new Generic_Bounded_Ordered_Set (Item => integer, The_Size => 10, Is_Equal => "="); type Selector is (X,Y); type Variant (The_Selector : Selector := X) is record case The_Selector is when X => A_Set : Test_Bounded_Ordered_Set.Set; when Y => null; end case; end record; begin null; end Bug; generic type Item is private; The_Size : Positive; with function is_equal(l,r:item) return boolean is "="; package Generic_Bounded_Ordered_Set is type Set is private; -- constructors procedure Clear (The_Set : in out Set); procedure Copy (From_The_Set : in Set; To_The_Set : out Set); procedure Add (Into_The_Set : in out Set; The_Item : in Item); procedure Insert (Into_The_Set : in out Set; The_Item : in Item; At_Position : in Positive); procedure Delete (From_The_Set : in out Set; At_Position : in Positive); procedure Update (In_The_Set : in out Set; At_Position : in Positive; With_New_Value : in Item); -- selectors function The_Value_Of (In_The_Set : Set; At_Position : Positive) return Item; function The_Position_Of (In_The_Set : Set; With_Value : Item) return Natural; function Is_Full (The_Set : Set) return Boolean; function Is_Empty (The_Set : Set) return Boolean; function Current_Count (Of_The_Set : Set) return Natural; -- iterators generic with procedure Process (The_Item : in Item; Continue : in out Boolean); procedure Iterate (Over_The_Set : in Set); -- exception Generic_Bounded_Ordered_Set_Error : exception; private -- Declared a new item below:- type An_Item is record This_Item : Item; Used : Boolean := false; end record; subtype set_index is Positive range 1 .. the_size; -- --!!!!WARNING Ref 354.1 - Array with dynamic bounds type Set is array (set_index) of An_Item; end Generic_Bounded_Ordered_Set;