comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: formal package question
Date: Mon, 14 Feb 2011 07:38:51 -0800 (PST)
Date: 2011-02-14T07:38:51-08:00	[thread overview]
Message-ID: <8d80291a-0c0d-4b66-9a30-5f8607d0234b@8g2000prt.googlegroups.com> (raw)
In-Reply-To: 4d58fd11$0$6770$9b4e6d93@newsspool3.arcor-online.net

On Feb 14, 1:59 am, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
wrote:
> On 14.02.11 03:46, ytomino wrote:
>
>
>
>
>
> > 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?
>
> I get an error for B2, probably using a different GNAT.
> Not really an answer, but can you leave out the "others"
> in ([others =>] <>) ?

Yes, it compiles for me if I say F(<>) but gets an error with F(others
=> <>).  There should be no difference between the two syntaxes, so
this is an error in the compiler.

                               -- Adam




  reply	other threads:[~2011-02-14 15:38 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
2011-02-15  0:08   ` ytomino
2011-02-14  9:59 ` Georg Bauhaus
2011-02-14 15:38   ` Adam Beneschan [this message]
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