Unfortunately, you can't add the annotation to an interface with more than one method, even if those methods are default methods, at least as it is currently implemented.
I can't remember the exact specifics around why this is the case, but believe it has to do with handling functions passed from js into java, and not being able to nicely handle instances that decide to override those other methods as well. You could nearly achieve this effect by just making a method reference to the "apply" or "test" method, and passing that as an actual JsFunction type. I don't right away see a problem with syntactic sugar doing this automatically, but am sure that someone will be able to enlighten us as to what confusing side effects this might have (or alternately confirm that this is a great idea, and point to where in the compiler the changes need to be made). On Wed, May 11, 2016, 6:15 PM David Becker <david.bec...@sencha.com> wrote: > I think it would be good to add @JsFunction to all of the > java.util.function interfaces in the JRE Emulation so that we can use > standard function signatures with JsInterop. > > Would that work? Any drawbacks? > > If you think that's a good idea, I can submit a patch. > > Thanks! > > -- > 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 google-web-toolkit-contributors+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-web-toolkit-contributors/13df9bed-108f-4cdf-8c00-123f1186e461%40googlegroups.com > <https://groups.google.com/d/msgid/google-web-toolkit-contributors/13df9bed-108f-4cdf-8c00-123f1186e461%40googlegroups.com?utm_medium=email&utm_source=footer> > . > 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 google-web-toolkit-contributors+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CADcXZMzaxRmFrvZUkQMG0VQETyJo5TWmjtFqPsn3msrBBvvLGg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.