comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Indefinite Containers of Indefinite Private Types
Date: Mon, 3 Aug 2015 19:23:23 -0700
Date: 2015-08-03T19:23:23-07:00	[thread overview]
Message-ID: <mpp7js$kac$2@dont-email.me> (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


             reply	other threads:[~2015-08-04  2:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04  2:23 Jeffrey R. Carter [this message]
2015-08-04  5:40 ` Indefinite Containers of Indefinite Private Types 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
replies disabled

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