From: Victor Porton <porton@narod.ru>
Subject: Rationale for this not to compile?
Date: Thu, 24 Jul 2014 23:53:32 +0300
Date: 2014-07-24T23:53:32+03:00 [thread overview]
Message-ID: <lqrro8$hbi$1@speranza.aioe.org> (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
next reply other threads:[~2014-07-24 20:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-24 20:53 Victor Porton [this message]
2014-07-24 21:36 ` Rationale for this not to compile? 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox