and the plot thickens.

I looked into the source for GWT and found the JSORestrictionsChecker. It 
references jsoRestrictions.html. I read through it but if I read it 
correctly it does not prohibit overloading methods - only overriding 
methods is prohibited.

The JSORestrictionsChecker calls checkJsTypeMethodsForOverloads();

I just commented that line out, and now everything works fine. I can now 
run code like this:

        context.drawImage(img, 0, 0);
        context.drawImage(img, 100, 100, 16, 16);
        context.drawImage(img, 32, 32, 32, 32, 120, 120, 32, 32);

        Path2D path = createPath2D();
        path.rect(10, 10, 100, 100);
        context.stroke(path);

        context.beginPath();
        context.moveTo(0, 0);
        context.lineTo(200, 200);
        context.stroke();

So is it a bug that JSORestrictionsChecker checks for overloaded methods?

/Rene

Den fredag den 12. december 2014 23.10.24 UTC+1 skrev rhmoller:
>
> fyi: this is with GWT build from master.
>
> /Rene
>
> Den fredag den 12. december 2014 23.00.15 UTC+1 skrev rhmoller:
>>
>> Hi
>>
>> I am toying around with generating Java interfaces annotated with @JsType 
>> and @JsProperty from webidl. But I have a problem with overloaded methods.
>>
>> For example: The idl for CanvasRenderingContext2 has several overloaded 
>> methods
>>
>> fx
>>
>>   void stroke();
>>   void stroke(Path2D path);
>>
>> and
>>
>>   ImageData createImageData(double sw, double sh);
>>   ImageData createImageData(ImageData imagedata);
>>
>> I can generate a corresponding Java interface with the overloaded 
>> methods, but the GWT compiler fails with this
>>
>> Error:(75, 0) GWT Compiler: JsType methods cannot overload another method.
>>
>> I know JS does not support function overloading as such, but on the other 
>> hand, you can pass anything to a js function regardless of the specified 
>> parameters.
>>
>> Do you have any ideas for how I can resolve these issues?
>>
>> /Rene
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to