From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Indefinite Containers of Indefinite Private Types Date: Mon, 3 Aug 2015 19:23:23 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 4 Aug 2015 02:21:49 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="ee44d3db9c41f5ad88d7e8e8f0268f05"; logging-data="20812"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hBZBqmxIs15xV9edDR2CcYxnjgOZTDVY=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 X-Mozilla-News-Host: news://freenews.netfront.net Cancel-Lock: sha1:qASm504VltPYkxRhXZ3azKf/kQY= Xref: news.eternal-september.org comp.lang.ada:27348 Date: 2015-08-03T19:23:23-07:00 List-Id: 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