Re: Generic instantiation with constrained subtype



"Jeffrey R. Carter" <spam.jrcarter.not@xxxxxxxxxxxx> writes:

Simon Wright wrote:

type T is new Base with private;

type T (<>) is new Base with private;

eliminates the compiler errors. It may not be suitable for your needs,
however.

Hmm, I need to be able to say

generic
type T (<>) is new Base with private;
package G is
O : T;
end G;

Ah! I can provide an initialising value!

generic
type T (<>) is new Base with private;
V : T;
package G is
O : T := V;
end G;

A : Constrained;

package F is new G (Constrained, A);

-- and it works fine! Thanks for the help ..
.



Relevant Pages