Weird package visibility issues

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird package visibility issues

Mihail Ivanchev
Hello folks,


For some unknown reason classes within the same package cannot access AssetDescriptor, but classes outside the package are able to. Is this a bug or intentional?

Regards,
M. Ivanchev

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Weird package visibility issues

singmajesty
I think they need to explicitly import foo.bar.AssetManager in order to  
gain reference to the included typedef


On Thu, 06 Oct 2011 09:41:08 -0700, Mihail Ivanchev <[hidden email]>  
wrote:

> Hello folks,
>
> here is my code: http://pastebin.com/J7zt0ZXp
>
> For some unknown reason classes within the same package cannot access
> AssetDescriptor, but classes outside the package are able to. Is this a  
> bug
> or intentional?
>
> Regards,
> M. Ivanchev

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Weird package visibility issues

Franco Ponticelli
In reply to this post by Mihail Ivanchev
I don't think the reason is unknown ... I just think that your file is named AssetManager.hx and when you use it form other packages you are forced to import it (making AssetDescriptor available) but in the same package you are not importing; the consequence is that AssetManager is still visible because on the same level, but AssetDescriptor is not because never imported.
The solutions are 2:
* always export explicitly AssetManager even when working in the same package
* move AssetDescriptor to its own module (file).

Franco

On Thu, Oct 6, 2011 at 5:41 PM, Mihail Ivanchev <[hidden email]> wrote:
Hello folks,


For some unknown reason classes within the same package cannot access AssetDescriptor, but classes outside the package are able to. Is this a bug or intentional?

Regards,
M. Ivanchev

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org