comp.lang.ada
 help / color / mirror / Atom feed
* Indefinite Containers of Indefinite Private Types
@ 2015-08-04  2:23 Jeffrey R. Carter
  2015-08-04  5:40 ` Niklas Holsti
  0 siblings, 1 reply; 10+ messages in thread
From: Jeffrey R. Carter @ 2015-08-04  2:23 UTC (permalink / raw)


This is legal:

package Indefinite1 is
   type T (<>) is private;
private -- Indefinite1
   type T is new String;
end Indefinite1;

with Indefinite1;
with Ada.Containers.Indefinite_Vectors;

package Indefinite2 is
   use type Indefinite1.T;

   package Lists is new Ada.Containers.Indefinite_Vectors
      (Index_Type => Positive, Element_Type => Indefinite1.T);
end Indefinite2;

But this isn't:

with Ada.Containers.Indefinite_Vectors;

package Indefinite1 is
   type T (<>) is private;
private -- Indefinite1
   package Lists is new Ada.Containers.Indefinite_Vectors
      (Index_Type => Positive, Element_Type => T);

   type T is new String;
end Indefinite1;

It seems to me that both instantiations have all the information they need.
Probably I'm missing something, but why is the latter illegal?

-- 
Jeff Carter
"English bed-wetting types."
Monty Python & the Holy Grail
15


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

end of thread, other threads:[~2015-08-07 20:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-04  2:23 Indefinite Containers of Indefinite Private Types Jeffrey R. Carter
2015-08-04  5:40 ` Niklas Holsti
2015-08-04 18:56   ` Jeffrey R. Carter
2015-08-04 20:47     ` Randy Brukardt
2015-08-04 20:56       ` Jeffrey R. Carter
2015-08-06 18:49         ` Randy Brukardt
2015-08-06 20:12           ` Jeffrey R. Carter
2015-08-07 19:49             ` Randy Brukardt
2015-08-07 20:13     ` Bob Duff
2015-08-07 20:45       ` Jeffrey R. Carter

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