comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Visibility of package parameters in child packages
Date: Wed, 16 Dec 2009 18:19:48 -0600
Date: 2009-12-16T18:19:48-06:00	[thread overview]
Message-ID: <hgbtf5$va5$1@munin.nbi.dk> (raw)
In-Reply-To: 02e4d172-0eb9-4c2a-ac0f-68e151916d59@o19g2000vbj.googlegroups.com

"Andrea Taverna" <a.tavs@hotmail.it> wrote in message 
news:02e4d172-0eb9-4c2a-ac0f-68e151916d59@o19g2000vbj.googlegroups.com...
...
>-----%<-----%<-----%<-----%<-----%<
>]# gnatmake main.adb
>gcc -c main.adb
>main.adb:9:05: instantiation error at parent-child.adb:6
>main.adb:9:05: "F" is not visible (more references follow)
>main.adb:9:05: instantiation error at parent-child.adb:6
>main.adb:9:05: non-visible declaration at q.ads:3
>gnatmake: "main.adb" compilation error
>-----%<-----%<-----%<-----%<-----%<

I haven't studied this code carefully, but this error message suggests to me 
that the compiler has a bug. An instantiation should never, ever be illegal 
because of something that occurs in the body of the generic. Legality rules 
don't apply to generic bodies at instantiation time (only when the generic 
unit is compiled).

It's possible that the compiler has delayed the compilation of the body to 
the point of the instantation, but even then, the error (if there is one, 
and I don't think there is) belongs to the body, not the instantiation. So 
at the very least the error message is misleading.

So I suggest reporting this to your vendor and see what they say. (And I'm 
glad I'm not your vendor in this case, 'cause I wouldn't want to have to 
debug this one. ;-)

                                   Randy.







  parent reply	other threads:[~2009-12-17  0:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 19:28 Visibility of package parameters in child packages Andrea Taverna
2009-12-15 21:00 ` Georg Bauhaus
2009-12-16 11:50   ` Andrea Taverna
2009-12-16 13:14     ` Georg Bauhaus
2009-12-16 14:21       ` Andrea Taverna
2009-12-16 15:54         ` Georg Bauhaus
2009-12-16 16:54           ` Andrea Taverna
2009-12-16 18:54             ` Georg Bauhaus
2009-12-16 21:44               ` Adam Beneschan
2009-12-16 21:26             ` sjw
2009-12-17  0:19     ` Randy Brukardt [this message]
2009-12-17 18:50       ` Ludovic Brenta
2009-12-16 21:27 ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox