Overloads are currently not allowed except for @JsProperty setters and
getters in C-style initializer pattern, e.g

interface Foo {
  @JsProperty
  void x(int a); // this is a setter
  @JsProperty
  int x(); // this is a getter
}

We plan to relax this restriction in the future. @JsMethod will be the
short term workaround coming soon.


On Wed, Nov 5, 2014 at 1:24 AM, confile <[email protected]> wrote:
> I also tried method overlaying based on Parameter types.
>
> @JsType(prototype = "$wnd.Kinetic.Node")
> public interface KNode {
> void fire(String eventType, JavaScriptObject evt, KNodeEventCallbackJSO
> option);
> void fire(String eventType);
> }
>
> This does not work. I get the following error:
>
> [ERROR] Line 100: JsType methods cannot overload another method.
>
>    [ERROR] Aborting compile due to errors in some input files
>
>
>
> Am Dienstag, 4. November 2014 21:04:29 UTC+1 schrieb Goktug Gokdogan:
>>
>> Sorry guys. When I said next release, I meant next major release (2.8 or
>> 3.0).
>>
>> On Tue, Nov 4, 2014 at 8:04 AM, Cristian Rinaldi <[email protected]>
>> wrote:
>>>
>>> @confile
>>>
>>>   @goktug said "However we don't have an ETA for this and 2.7 is already
>>> at RC1 so you need to wait for the next release."
>>>   This may mean:
>>>
>>>   1) wait until the 2.7.0-rc2 or
>>>   2) wait until the next release of GWT (3.0.0)
>>>
>>>    In my opinion it is more likely to be version 3.0.0, because some
>>> things are missing, and many come with Java 8 support.
>>>
>>>    Perhaps @goktug can clarify the picture.
>>>
>>> Greetings.
>>>
>>>
>>> El martes, 4 de noviembre de 2014 11:04:03 UTC-3, confile escribió:
>>>>
>>>> @Cristian I did not get what you say. Will this be part of GWT 2.7
>>>> release?
>>>>
>>>>
>>>>
>>>> Am Dienstag, 4. November 2014 13:56:46 UTC+1 schrieb Cristian Rinaldi:
>>>>>
>>>>> @Goktug:
>>>>>    This news is great !!!
>>>>>    The issue of the overload was something he had already asked in
>>>>> another thread, it's good to read that will be supported.
>>>>>
>>>>> Thank you ...
>>>>>
>>>>> El martes, 4 de noviembre de 2014 08:40:15 UTC-3, Joost Gustavson
>>>>> escribió:
>>>>>>
>>>>>> +1 same here. Hope this get solved in GWT 2.7 RC2.
>>>>>>
>>>>>> Joost
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tuesday, November 4, 2014 12:15:10 AM UTC+1, Goktug Gokdogan wrote:
>>>>>>>
>>>>>>> Method overloading is supposed to be ok if there is no prototype is
>>>>>>> given, however in your case prototype is provided hence even if we fix 
>>>>>>> it,
>>>>>>> it will not work for your case.
>>>>>>>
>>>>>>> There two ways to cover your use case here. One is making var-args
>>>>>>> work (if it is not already working) so that you can do something like
>>>>>>> following to cover both in single method:
>>>>>>>
>>>>>>>   boolean draggable(Object... args)
>>>>>>>
>>>>>>> You can give it a try and see if works (but I doubt it will work
>>>>>>> right now).
>>>>>>>
>>>>>>> The second way is to support overloading. We already decided to
>>>>>>> support overloading at least based on number of arguments and this 
>>>>>>> scenario
>>>>>>> is covered under that.
>>>>>>>
>>>>>>> However we don't have an ETA for this and 2.7 is already at RC1 so
>>>>>>> you need to wait for the next release.
>>>>>>>
>>>>>>> On Mon, Nov 3, 2014 at 1:27 PM, confile <[email protected]>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Will the custom names method be part of the GWT 2.7 release? That
>>>>>>>> would be great. I think with this method you can handle nearly 
>>>>>>>> everything
>>>>>>>> with JsInterop.
>>>>>>>>
>>>>>>>> When I tried the above JsType as Interface I get the following
>>>>>>>> error:
>>>>>>>>
>>>>>>>> GET /recompile/mobilePhoneGapIOS
>>>>>>>>    Job test.mobile.MobilePhoneGapIOS_1_6
>>>>>>>>       starting job: test.mobile.MobilePhoneGapIOS_1_6
>>>>>>>>       binding: mgwt.density=xhigh
>>>>>>>>       Compiling module test.mobile.MobilePhoneGapIOS
>>>>>>>>          Ignored 1 unit with compilation errors in first pass.
>>>>>>>> Compile with -strict or with -logLevel set to TRACE or DEBUG to see
>>>>>>>> all errors.
>>>>>>>>          Tracing compile failure path for type
>>>>>>>> 'org.test.kinetic.client.KNode'
>>>>>>>>             [ERROR] Errors in
>>>>>>>> 'file:/Users/mg/Documents/Grails/GGTS3.5.1Test/test/src/gwt/org/test/kinetic/client/KNode.java'
>>>>>>>>                [ERROR] Line 22: JsType methods cannot overload
>>>>>>>> another method.
>>>>>>>>             [ERROR] Errors in
>>>>>>>> 'file:/Users/mg/Documents/Grails/GGTS3.5.1Test/test/src/gwt/org/test/kinetic/client/events/KNodeEventCallbackJSO.java'
>>>>>>>>                [ERROR] org.test.kinetic.client.events.KNodeEvent
>>>>>>>> cannot be resolved to a type
>>>>>>>>             [ERROR] Errors in
>>>>>>>> 'file:/Users/mg/Documents/Grails/GGTS3.5.1Test/test/src/gwt/org/test/kinetic/client/events/KNodeEvent.java'
>>>>>>>>                [ERROR] org.test.kinetic.client.KShape cannot be
>>>>>>>> resolved to a type
>>>>>>>>             [ERROR] Errors in
>>>>>>>> 'file:/Users/mg/Documents/Grails/GGTS3.5.1Test/test/src/gwt/org/test/kinetic/client/KShape.java'
>>>>>>>>                [ERROR] org.test.kinetic.client.KNode cannot be
>>>>>>>> resolved to a type
>>>>>>>>          Computing all possible rebind results for
>>>>>>>> 'test.mobile.client.app.photoEditor.PhotoEditor.Resources'
>>>>>>>>             Rebinding
>>>>>>>> test.mobile.client.app.photoEditor.PhotoEditor.Resources
>>>>>>>>                Checking rule <generate-with
>>>>>>>> class='com.googlecode.gwtphonegap.server.log.rebind.PhoneGapLogThresholdGenerator'/>
>>>>>>>>                   [ERROR] Hint: Check the inheritance chain from
>>>>>>>> your module; it may not be inheriting a required module or a module 
>>>>>>>> may not
>>>>>>>> be adding its source path entries properly
>>>>>>>>          [ERROR] Errors in
>>>>>>>> 'test/mobile/client/app/photoEditor/PhotoEditor.java'
>>>>>>>>             [ERROR] Line 67: Failed to resolve
>>>>>>>> 'test.mobile.client.app.photoEditor.PhotoEditor.Resources' via deferred
>>>>>>>> binding
>>>>>>>>          Unification traversed 510 fields and methods and 343 types.
>>>>>>>> 15 are considered part of the current module and 15 had all of their 
>>>>>>>> fields
>>>>>>>> and methods traversed.
>>>>>>>>          [WARN] Some stale types ([org.test.kinetic.client.KNode])
>>>>>>>> were not reprocessed as was expected. This is either a compiler bug or 
>>>>>>>> a
>>>>>>>> Generator has legitimately stopped creating these types.
>>>>>>>>       [ERROR] Compiler returned false
>>>>>>>>       [WARN] recompile failed
>>>>>>>>       [WARN] continuing to serve previous version
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Michael
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am Montag, 3. November 2014 20:00:29 UTC+1 schrieb Goktug Gokdogan:
>>>>>>>>>
>>>>>>>>> There is going to be a JsMethod to provide custom names to the
>>>>>>>>> method so that you can name the method as abc() and map it to xyx() 
>>>>>>>>> in the
>>>>>>>>> js.
>>>>>>>>>
>>>>>>>>> But before that I didn't understand why it doesn't work out of the
>>>>>>>>> box. You are not overloading based on return type; one of the methods 
>>>>>>>>> has an
>>>>>>>>> argument and the other one doesn't have any?
>>>>>>>>>
>>>>>>>>> On Mon, Nov 3, 2014 at 1:13 AM, confile
>>>>>>>>> <[email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>> Consider the following JavaScript functions:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> // get draggable flag
>>>>>>>>>> var draggable = node.draggable();
>>>>>>>>>>
>>>>>>>>>> // enable drag and drop
>>>>>>>>>> node.draggable(true);
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I do not see how I can modle them in JsInterop. The following
>>>>>>>>>> would not work:
>>>>>>>>>>
>>>>>>>>>> @JsType(prototype = "$wnd.Kinetic.Node")
>>>>>>>>>>
>>>>>>>>>> public interface KNode {
>>>>>>>>>>
>>>>>>>>>>  void draggable(boolean value);
>>>>>>>>>>
>>>>>>>>>>  boolean draggable();
>>>>>>>>>>
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> The former would not work because overlaying in Java based on
>>>>>>>>>> return type is forbidden. I also could not use @JsProperty because 
>>>>>>>>>> the
>>>>>>>>>> getter and setter are JavaScript functions.
>>>>>>>>>>
>>>>>>>>>> Is there another way to deal with this in JsInterop?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>>> Groups "GWT Contributors" group.
>>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>>> send an email to
>>>>>>>>>> [email protected].
>>>>>>>>>> To view this discussion on the web visit
>>>>>>>>>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/862d9a24-3a07-4181-9cc0-17b7a26401ee%40googlegroups.com.
>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "GWT Contributors" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to
>>>>>>>> [email protected].
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/6dfbc8e7-9997-4918-aeb3-befea70bd9d2%40googlegroups.com.
>>>>>>>>
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "GWT Contributors" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/e1e7513e-dbb0-4326-934c-8cbd2e720aba%40googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/936ecb2f-4c1d-483a-ab8e-7d958b951777%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAPVRV7ezT9fH6e7OufjAF3T%2BuuJ3Oa%3D-2mvLD_nkavDXzfh3ng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to