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,be8694f4e88e113d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-29 09:43:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: problems with generic package Date: 29 May 2002 12:34:08 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3CF49A99.1050005@domain.invalid> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1022690496 13554 128.183.220.71 (29 May 2002 16:41:36 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 29 May 2002 16:41:36 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:24944 Date: 2002-05-29T16:41:36+00:00 List-Id: user@domain.invalid writes: > error: > > instantiation error > unconstrained subtype in component declaration > actual for "Element" must be a definite subtype The rules on "definite" vs "indefinite" vs "unconstrained" can be confusing. Without your complete code, I can't tell what the correct solution might be. See section 12.5.1 in the ARM, or the chapter on generic formal types in your favorite Ada book. In this case, the error message is telling you that the actual type ('node') you are providing to match Element has an unconstrained component, which makes it an indefinite subtype. Since you define 'node' as: type node is tagged null record; this doesn't make much sense. Please provide the actual code you compiled, and the complete error message. One way to let a generic formal type accept an unconstrained subtype is to add an unknown discriminant (ARM 12.5.1 (28), ARM 3.7 (3)): generic type Element (<>) is private; package Generic_Set is ... end package; But that may not be what you want. > > > > thanks for any help > -- -- Stephe