comp.lang.ada
 help / color / mirror / Atom feed
From: simonson@beaver.cs.washington.edu  (Kevin Simonson)
Subject: Re: Ada question: access types
Date: 5 Oct 92 15:38:17 GMT	[thread overview]
Message-ID: <1992Oct5.153817.29108@beaver.cs.washington.edu> (raw)

     In article <60887@mimsy.umd.edu> alex@cs.umd.edu (Alex Blakemore) writes:

=In article <1992Oct4.211734.9047@seas.gwu.edu> nreich@seas.gwu.edu (Norman
=Reich) writes:
=
=Assume
=package my_types is
=
=>      TYPE ptr IS ACCESS node;
=>      TYPE node IS
=>        RECORD
=>          name ...
=>          ...
=>          nextn :ptr;
=>        END RECORD;
=>      nl :ptr;
=
=and in another library unit 
=>      if (nl = NULL) then          --error at this line
=>      type clash in parameter to "="
=
=type ptr is probably in a different package than the if statement.
=you probably made type ptr visible via a with clause and did not
=make it _directly_ visible via a use clause.

     This is probably the problem, but let me also note that after copying
exactly what Norman had written into a _single_ file, I got nearly the
same error message he was talking about.

     My compiler (Verdix) told me:

   if (nl = NULL) then
---------#^#
-- error: RM 4.5: does not conform to any visible operator              #^#

which sounded similar to the error message Norman got.

     However, earlier in my code I also got the message:

   TYPE ptr IS ACCESS node;
---------------------#^#
-- error: RM 8.3: identifier undefined                                  #^#

     Apparently if "nl" is defined as a type that the compiler doesn't un-
derstand, then it concludes that the type of "nl" doesn't match with
"NULL".  I added

   type node;

earlier in the program and it compiled just fine.  Norman, you might check
your code to make sure you referred to type "node" before the line that de-
fined "ptr".

                                     ---Kevin

             reply	other threads:[~1992-10-05 15:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-10-05 15:38 Kevin Simonson [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-10-05  2:33 Ada question: access types Alex Blakemore
1992-10-04 21:17 Norman Reich
replies disabled

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