helper class masking file class

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

helper class masking file class

bubblebenj
Hello,

I'm experiencing an annoying compilation problem, trying to implement an AsyncProxy:
I've 3 classes and one interface (I’m not sure the interface has something to do with the problem):
- In the root folder "Src":
        - A main class "GameClient"
        - A "static" class "GameGlb" (all members and functions are static)
        - A helper class "ApiProxy" that implements the "AsyncProxy<IServerApi>" in GameGlb.hx
- in a subdirectory
        - the interface IServerApi

- my hxml :
        -cp ./Src/

        ### main class
        -main GameClient

        ### Output file
        -swf ./WWW/GameClient.swf
        -swf-version 10

First thing:
        The helper class ApiProxy in GameGlb seems to hide the GameGlb class from GameClient class.
At compile time I get a
./Src/GameClient.hx:20: characters 2-9 : Unknown identifier : GameGlb
despite it is located in the same folder.
(Naturally commenting the helper class gives me a successful compilation)
I'm probably mistaking somewhere and I'd be glad to have an error message telling me what is wrong with my code.

Second thing:
        I've tried to import GameGlb in GameClient anyway.
And the compile time message is anything but helpful:
Not_found
Hard to make a shorter message. It doesn't tell me what is not found or even what kind of thing is not found.
        I'm not an experimented programmer, but I really like haxe.
However if I didn't personally know people that can look at my code to help me with errors, I'd probably have give up haxe already, and I'm confident to say some people have.

Last thing:
        I've searched the web for a description of compile time errors, a wiki or something like that.
There is obviously no such thing.
I'd be glad to help in this task. Maybe someone could tell me the good place to start it?

Thank for your help guys
Reply | Threaded
Open this post in threaded view
|

Re: helper class masking file class

Nicolas Cannasse
Le 26/03/2011 09:20, bubblebenj a écrit :
> Second thing:
> I've tried to import GameGlb in GameClient anyway.
> And the compile time message is anything but helpful:
> Not_found
> Hard to make a shorter message. It doesn't tell me what is not found or even
> what kind of thing is not found.

This is an internal compiler exception that shouldn't occur. Could you
try reproducing this error with the minimal code and post it on
http://code.google.com/p/haxe/issues so it can be fixed ?

Best,
Nicolas

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

Re: helper class masking file class

Simon Krajewski
Am 26.03.2011 09:54, schrieb Nicolas Cannasse:

> Le 26/03/2011 09:20, bubblebenj a écrit :
>> Second thing:
>>     I've tried to import GameGlb in GameClient anyway.
>> And the compile time message is anything but helpful:
>> Not_found
>> Hard to make a shorter message. It doesn't tell me what is not found
>> or even
>> what kind of thing is not found.
>
> This is an internal compiler exception that shouldn't occur. Could you
> try reproducing this error with the minimal code and post it on
> http://code.google.com/p/haxe/issues so it can be fixed ?

Hi,

IIRC this happens if you use an import instead of the fully qualified
name for the type parameter of AsyncProxy, i.e.

     import path.to.my.Interface;
     class Api extends AsyncProxy<Interface>

instead of

     class Api extends AsyncProxy<path.to.my.Interface>

Regards
Simon



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

Re: helper class masking file class

bubblebenj
i confirm that a "fully qualified name for the type parameter of AsyncProxy" make that the compiler go to the next step.

i'll patch it like that until it has been corrected.

Thanks

PS : Nicolas, I've posted my code anyway.
Reply | Threaded
Open this post in threaded view
|

Re: helper class masking file class

Dion Whitehead Amago
In reply to this post by Simon Krajewski
I believe that was the underlying cause of this issue for me:
http://code.google.com/p/haxe/issues/detail?id=348

Dion

On Sat, Mar 26, 2011 at 5:54 AM, Simon Krajewski <[hidden email]> wrote:

> Am 26.03.2011 09:54, schrieb Nicolas Cannasse:
>>
>> Le 26/03/2011 09:20, bubblebenj a écrit :
>>>
>>> Second thing:
>>>    I've tried to import GameGlb in GameClient anyway.
>>> And the compile time message is anything but helpful:
>>> Not_found
>>> Hard to make a shorter message. It doesn't tell me what is not found or
>>> even
>>> what kind of thing is not found.
>>
>> This is an internal compiler exception that shouldn't occur. Could you try
>> reproducing this error with the minimal code and post it on
>> http://code.google.com/p/haxe/issues so it can be fixed ?
>
> Hi,
>
> IIRC this happens if you use an import instead of the fully qualified name
> for the type parameter of AsyncProxy, i.e.
>
>    import path.to.my.Interface;
>    class Api extends AsyncProxy<Interface>
>
> instead of
>
>    class Api extends AsyncProxy<path.to.my.Interface>
>
> Regards
> Simon
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

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