* generic parameter to generic package
@ 2004-01-20 16:27 Mr. J.
2004-01-20 16:47 ` Robert I. Eachus
2004-01-20 17:55 ` Jeffrey Carter
0 siblings, 2 replies; 3+ messages in thread
From: Mr. J. @ 2004-01-20 16:27 UTC (permalink / raw)
I have the following not compiling code:
============================================
generic
type Language is array (Positive range<>) of Character;
type States is array (Positive range <>) of Integer;
package Automat_Producer is
...
===========================================================
And also :
*************************************************************
with Automat_Producer;
generic
with package My_Automat is new Automat_Producer (<>);
procedure Apply_String(Auto: in My_Automat; S:String);
*******************************************************************
What M I doing wrong ?
Compiler error:
apply_string.ads:6:33: subtype mark required in this context
apply_string.ads:6:33: found "My_Automat" declared at line 4
10x,
J.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: generic parameter to generic package
2004-01-20 16:27 generic parameter to generic package Mr. J.
@ 2004-01-20 16:47 ` Robert I. Eachus
2004-01-20 17:55 ` Jeffrey Carter
1 sibling, 0 replies; 3+ messages in thread
From: Robert I. Eachus @ 2004-01-20 16:47 UTC (permalink / raw)
Mr. J. wrote:
> I have the following not compiling code:
> What M I doing wrong ?
For one thing eliding the code that is needed to answer your question. I
assume that there is a type inside the package Automat_Producer that
should be appended to My_Automat to fix the problem. (In other words,
instead of My_Automat as a subtype you need to write My_Automat.Some_Type.)
--
Robert I. Eachus
"The war on terror is a different kind of war, waged capture by capture,
cell by cell, and victory by victory. Our security is assured by our
perseverance and by our sure belief in the success of liberty." --
George W. Bush
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: generic parameter to generic package
2004-01-20 16:27 generic parameter to generic package Mr. J.
2004-01-20 16:47 ` Robert I. Eachus
@ 2004-01-20 17:55 ` Jeffrey Carter
1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey Carter @ 2004-01-20 17:55 UTC (permalink / raw)
Mr. J. wrote:
> What M I doing wrong ?
>
> Compiler error:
>
> apply_string.ads:6:33: subtype mark required in this context
>
> apply_string.ads:6:33: found "My_Automat" declared at line 4
The compiler messages seem pretty clear: a subtype mark is required, and
you're supplying "My_Automat", which is not a subtype mark (it's a
package name). Packages are not (sub)types, and subprogram parameters
can only be (sub)types.
--
Jeff Carter
"It's symbolic of his struggle against reality."
Monty Python's Life of Brian
78
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-01-20 17:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-20 16:27 generic parameter to generic package Mr. J.
2004-01-20 16:47 ` Robert I. Eachus
2004-01-20 17:55 ` Jeffrey Carter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox