From: anon@att.net
Subject: Re: formal package question
Date: Mon, 14 Feb 2011 06:51:40 +0000 (UTC)
Date: 2011-02-14T06:51:40+00:00 [thread overview]
Message-ID: <ijajdr$bko$1@speranza.aioe.org> (raw)
In-Reply-To: a1ce6c12-d389-4685-95b2-68159efefadc@s11g2000prs.googlegroups.com
Typo:
package F2 is new F (Character, P); -- P => P
In <a1ce6c12-d389-4685-95b2-68159efefadc@s11g2000prs.googlegroups.com>, ytomino <aghia05@gmail.com> writes:
>Hello,
>Please look this code:
>
>--------
>package formalpkg is
>
> generic
> type T is private;
> with procedure P (X : T) is <>;
> package F is
> end F;
>
> generic
> with package FA is new F (others => <>);
> package B is
> end B;
>
> procedure P1 (X : Character) is null;
> package F1 is new F (Character, P1); -- use P => P1
>
> package B1 is new B (F1); -- Error !!
>
> procedure P (X : Character) is null;
> package F2 is new F (Character); -- P => P
>
> package B2 is new B (F2); -- OK
>
>end formalpkg;
>--------
>% gnatmake formalpkg.ads
>gcc -c formalpkg.ads
>formalpkg.ads:17:25: actual for "P" in actual instance does not match
>formal
>gnatmake: "formalpkg.ads" compilation error
>--------
>
>B1 was compile error, but B2 is ok. Why?
>Where is wrong in my code?
>I want to use instances of generic package with some different
>subprograms like B1...
>
>(I use gcc-4.5.1)
next prev parent reply other threads:[~2011-02-14 6:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-14 2:46 formal package question ytomino
2011-02-14 6:51 ` anon [this message]
2011-02-15 0:08 ` ytomino
2011-02-14 9:59 ` Georg Bauhaus
2011-02-14 15:38 ` Adam Beneschan
2011-02-15 0:31 ` ytomino
2011-02-15 8:17 ` Ludovic Brenta
2011-02-17 0:58 ` ytomino
2011-02-17 7:05 ` Ludovic Brenta
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox