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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4d448bf6bac07244 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: GNAT Problem on recursive generics? Date: 1996/12/01 Message-ID: #1/1 X-Deja-AN: 201713529 references: <57moem$phr@sun04.tfh-berlin.de> organization: New York University newsgroups: comp.lang.ada Date: 1996-12-01T00:00:00+00:00 List-Id: Debora asks about GNAT 3.05 (960607) Copyright 1991-1996 Free Software Foundation, Inc. Compiling: foo.adb (source file time stamp: 1996-11-27 16:17:58) 1. procedure foo (e: in out element) is 2. begin 3. if 1=1 then 4. foo(element'pred(e)); | >>> "foo" is not visible (more references follow) Well clearly this program is wrong, since foo has an in out parameter, and of course you cannot pass an expression like this, only a variable. However, the GNAT error message is certainly confusing, you did not say which version of GNAT you are using (remember that saying PC is not enough, GNAT is ported to nine different operating systems on the PC), but in any case the latest version of GNAT gives the clearer error messages: 2. -- foo.adb 3. procedure foo (e: in out element) is 4. begin 5. if 1=1 then 6. foo(element'pred(e)); | >>> actual for "e" must be a variable 7. else 8. foo(element'succ(e)); | >>> actual for "e" must be a variable 9. end if; 10. end foo; remember in future, if you find what you think is a bug in GNAT, be sure to submit it with complete sources, following the directions in gnatinfo.txt, to report@gnat.com if you want the GNAT folks to look at it!