* Generic instantiation in client vs child package
@ 1998-10-13 0:00 Marc A. Criley
1998-10-13 0:00 ` Tucker Taft
0 siblings, 1 reply; 2+ messages in thread
From: Marc A. Criley @ 1998-10-13 0:00 UTC (permalink / raw)
The following behavior is seen with GNAT 3.11b-beta on
Linux 2.0.33 (COL 1.2).
When instantiating a particular generic from Corey Minyard's "Ada
Structured Library" (http://www.concentric.net/~Minyard) I get a
clean compile in one situation and an error in another, and I'm
not sure why. I expect it's something I'm overlooking in Ada 95.
Given a simple package spec:
-- plain.ads
package Plain is
type P is private;
private
type P is new Integer;
end Plain;
The following instantiation of a dynamic list in a client package
compiles cleanly:
-- plain_list.ads
with ASGC.List.Dynamic; -- from ASL 1.0
with Plain;
package Plain_List is
package P_Container is new ASGC(Contained_Type => Plain.P,
"=" => Plain."=");
package P_List is new P_Container.List;
package P_List_Dyn is new P_List.Dynamic;
end Plain_List;
However, if I instantiate within a child, rather than client,
package:
-- plain-list.ads
with ASGC.List.Dynamic;
package Plain.List is
package P_Container is new ASGC(Contained_Type => P,
"=" => "=");
package P_List is new P_Container.List;
package P_List_Dyn is new P_List.Dynamic;
end Plain.List;
I get this error:
plain-list.ads:9:04: instantiation error at asgc-list-dynamic.ads:26
plain-list.ads:9:04: "Object" not declared in "List"
plain-list.ads:9:04: instantiation error at asgc-list-dynamic.ads:27
plain-list.ads:9:04: tagged type required, found type "Object" defined at
asgc-list-dynamic.ads:26, instance at line 9
<Two more similar error blocks are also produced>
Why is this instantiation acceptable in a client package, but not
in a child package?
--
Marc A. Criley
Chief Software Architect
Lockheed Martin ATWCS
marc.a.criley@lmco.com
Phone: (610) 354-7861
Fax : (610) 354-7308
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Generic instantiation in client vs child package
1998-10-13 0:00 Generic instantiation in client vs child package Marc A. Criley
@ 1998-10-13 0:00 ` Tucker Taft
0 siblings, 0 replies; 2+ messages in thread
From: Tucker Taft @ 1998-10-13 0:00 UTC (permalink / raw)
Marc A. Criley (marc.a.criley@lmco.com) wrote:
: The following behavior is seen with GNAT 3.11b-beta on
: Linux 2.0.33 (COL 1.2).
: When instantiating a particular generic from Corey Minyard's "Ada
: Structured Library" (http://www.concentric.net/~Minyard) I get a
: clean compile in one situation and an error in another, and I'm
: not sure why. I expect it's something I'm overlooking in Ada 95.
: ...
This sounds like a compiler bug. Because of the generic contract model,
errors that occur during instantiation should always be suspect...
: Given a simple package spec:
: -- plain.ads
: package Plain is
: type P is private;
: private
: type P is new Integer;
: end Plain;
: ...
: -- plain-list.ads
: with ASGC.List.Dynamic;
: package Plain.List is
: package P_Container is new ASGC(Contained_Type => P,
: "=" => "=");
: package P_List is new P_Container.List;
: package P_List_Dyn is new P_List.Dynamic;
: end Plain.List;
: I get this error:
: plain-list.ads:9:04: instantiation error at asgc-list-dynamic.ads:26
: plain-list.ads:9:04: "Object" not declared in "List"
: plain-list.ads:9:04: instantiation error at asgc-list-dynamic.ads:27
: plain-list.ads:9:04: tagged type required, found type "Object" defined at
: asgc-list-dynamic.ads:26, instance at line 9
: <Two more similar error blocks are also produced>
: Marc A. Criley
: Chief Software Architect
: Lockheed Martin ATWCS
: marc.a.criley@lmco.com
: Phone: (610) 354-7861
: Fax : (610) 354-7308
--
-Tucker Taft stt@inmet.com http://www.inmet.com/~stt/
Intermetrics, Inc. Burlington, MA USA
An AverStar Company
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-10-13 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-13 0:00 Generic instantiation in client vs child package Marc A. Criley
1998-10-13 0:00 ` Tucker Taft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox