comp.lang.ada
 help / color / mirror / Atom feed
From: Larry <lhazel@mindspring.com>
Subject: Re: Problem Compiling with GNAT
Date: 1999/03/16
Date: 1999-03-16T00:00:00+00:00	[thread overview]
Message-ID: <7clnqq$3m1$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 7cj6nt$rvh$1@nnrp1.dejanews.com

In article <7cj6nt$rvh$1@nnrp1.dejanews.com>,
  Larry <lhazel@mindspring.com> wrote:

> There is a type named Class in many packages and in one procedure the compiler
> seems to be confused about which Class is used.  Here is abbreviated code for
> that procedure:
>
> procedure Display (Next_Timed_Fire_Mission     : in Fire_Missions.Class;
>                    Next_Non_Timed_Fire_Mission : in Fire_Missions.Class) is
>
> -- Fire_Missions.Class is a private record type.
>
>    use Fire_Missions.Operators;
>    Not_Used : Boolean;
> begin
>
>    if Next_Timed_Fire_Mission_Gui.Item_Of
>       /= Next_Timed_Fire_Mission then
> --    ^ Error messages point to this line
>       Next_Timed_Fire_Mission_Gui.Set (Next_Timed_Fire_Mission);
>
>       if Next_Timed_Fire_Mission = Fire_Missions.Null_Value then
>
>             Display_This_Gui (This_Gui =>
>                               Next_Timed_Fire_Mission_Gui.Clear_Display,
>                               Continue => Not_Used);
>       else
>             Display_Next_Timed_Fire_Mission_Gui;
>       end if;
>
>    end if;
> end Display;
>
> This version gives the error messages:
>
>   expected type "Location_Data.Class" defined at location_data.ads:100
>   found type "Firing_Points.Class" defined at firing_points.ads:57
>
> If I comment out the use Fire_Missions.Operators; statement, I get:
>
>   operator for private type "Class" defined at fire_missions.ads:166
>     is not directly visible
>   use clause would make operation legal

This has generated some good discussion but no answers yet.  I got an email
from Robert Dewar "strongly" suggesting support from ACT and I'm working on
that but it's not going to happen quickly.

If you look at the error messages, you will see that the compiler finds the
correct "Class" for the comparison without the use clause but finds 2 other
types with the use clause.  This is what has me confused.

It is now even more confusing.	I edited all definitions and references to
Fire_Missions.Class to be Fire_Missions.Claxx.	There was no change in the
error messages other than the name change in the second set.  With the use
clause, GNAT still complains about "Location_Data.Class" and
"Firing_Points.Class".

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




      parent reply	other threads:[~1999-03-16  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-15  0:00 Problem Compiling with GNAT Larry
1999-03-15  0:00 ` Matthew Heaney
1999-03-15  0:00   ` Larry
1999-03-16  0:00     ` fraser
1999-03-16  0:00       ` Brian Rogoff
1999-03-16  0:00       ` Matthew Heaney
1999-03-16  0:00       ` Jean-Pierre Rosen
1999-03-16  0:00         ` Matthew Heaney
1999-03-19  0:00         ` Fraser Wilson
1999-03-16  0:00 ` Larry [this message]
replies disabled

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