comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: GNAT Problem on recursive generics?
Date: 1996/12/01
Date: 1996-12-01T00:00:00+00:00	[thread overview]
Message-ID: <dewar.849449458@merv> (raw)
In-Reply-To: 57moem$phr@sun04.tfh-berlin.de


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!






  reply	other threads:[~1996-12-01  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-29  0:00 GNAT Problem on recursive generics? Debora Weber-Wulff
1996-12-01  0:00 ` Robert Dewar [this message]
1996-12-02  0:00 ` Ray Blaak
1996-12-03  0:00   ` Debora Weber-Wulff
1996-12-03  0:00     ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox