comp.lang.ada
 help / color / mirror / Atom feed
* types in procedure arguments
@ 1996-09-23  0:00 Chris Papademetrious
  1996-09-25  0:00 ` Stephen Leake
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Chris Papademetrious @ 1996-09-23  0:00 UTC (permalink / raw)



 I've got a small problem that most likely extends from my lack of
knowledge about Ada 95, so I'm turning to the gurus for help.

 I have a procedure that I'd like to pass a list of "Points" (just a
two-dimensional coordinate) as an input.  Now, I have a doubly linked
list type defined in a package.  This package requires a generic
argument of what it is a linked list *of*, so, I need to instantiate
the list package with the parameter of type Point before I can define
the input argument as a List argument.

 No problem, I'll just put the procedure in a package wrapper, and
define the linked list type before the procedure, to make everything
happy!  Well, that works, except when I try to USE the procedure in
another package.  When I passed a list parameter where I call the
procedure, I get the following error:

 lazarus(10:55)/home/chrispy/bot > gnatmake best_test
gcc -c best_test.adb
best_test.adb:45:35: expected private type "LIST_ID" defined at
double_list.ads: 43
best_test.adb:45:35: found private type "LIST_ID" defined at
double_list.ads:43
gnatmake: "best_test.adb" compilation error

 The source location for the type it expected and the type it got are
the same, BUT they're incompatible types!  To me, this means that this
problem arises from the fact that I had to redefine the list type to
be able to specify it as a function argument in the procedure package
itself, because that is essentially a NEW, incompatible type.

 How the heck do I get around something like this??

 - Chris


-=-=-=-=-=-=-=-=-=-=-=-=-
 Chris Papademetrious
 Data Fusion Laboratory
 Drexel University
 Philadelphia, PA
-=-=-=-=-=-=-=-=-=-=-=-=-





^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: types in procedure arguments
@ 1996-09-28  0:00 Robert Dewar
  1996-09-30  0:00 ` Chris Papademetrious
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Dewar @ 1996-09-28  0:00 UTC (permalink / raw)



pdemrtious asked

about

"gcc -c best_test.adb
best_test.adb:45:35: expected private type "LIST_ID" defined at
double_list.ads: 43
best_test.adb:45:35: found private type "LIST_ID" defined at
double_list.ads:43
"

This is almost certainly a bug in GNAT, but you did not say what version
you are using (most such bugs were squashed a while ago). If you are using
the current version, or even a version from 3.04 on, then send along a bug
report to report@gnat.com. if you are using an earlier version, then upgrade
first.





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~1996-10-01  0:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-23  0:00 types in procedure arguments Chris Papademetrious
1996-09-25  0:00 ` Stephen Leake
1996-09-28  0:00 ` Chris Papademetrious
1996-09-28  0:00 ` Chris Papademetrious
1996-09-30  0:00 ` Chris Papademetrious
1996-10-01  0:00   ` Norman H. Cohen
1996-10-01  0:00   ` Robert A Duff
1996-10-01  0:00   ` Stephen Leake
1996-10-01  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1996-09-28  0:00 Robert Dewar
1996-09-30  0:00 ` Chris Papademetrious
1996-09-30  0:00   ` Norman H. Cohen
1996-09-30  0:00   ` Stephen Leake

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