comp.lang.ada
 help / color / mirror / Atom feed
* Rationale for this not to compile?
@ 2014-07-24 20:53 Victor Porton
  2014-07-24 21:36 ` Adam Beneschan
  2014-07-25 13:18 ` Victor Porton
  0 siblings, 2 replies; 9+ messages in thread
From: Victor Porton @ 2014-07-24 20:53 UTC (permalink / raw)


Is there any rationale why this does not compile? If it compiled, it would 
be probably useful in practice with a real example similar to the below toy 
example (as to make the type T not private, I must create an *.Internal.* 
package to serve as a "private repository" for types like T, as real private 
types cannot be used). It is called a hack.

gnatmake -q -c -gnatc -u -P/home/porton/t/default.gpr test.ads
test.ads:10:32: premature use of private type
gnatmake: "/home/porton/t/test.ads" compilation error

package Test is

   generic
      type T is limited private;
   package Gen is
   end Gen;
   
   type X is private;

   package Instance is new Gen(X);
   
private
   
   type X is null record;
   
end Test;

-- 
Victor Porton - http://portonvictor.org


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

end of thread, other threads:[~2014-07-25 20:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-24 20:53 Rationale for this not to compile? Victor Porton
2014-07-24 21:36 ` Adam Beneschan
2014-07-25  5:29   ` Randy Brukardt
2014-07-25 12:19     ` Victor Porton
2014-07-25 12:35       ` AdaMagica
2014-07-25 14:40     ` Robert A Duff
2014-07-25 19:45       ` Randy Brukardt
2014-07-25 20:33         ` Robert A Duff
2014-07-25 13:18 ` Victor Porton

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