Monday, August 29, 2016

jsinterop export method that returns Optional

I'm trying to export a Java method with @JsMethod which returns an Optional. 

Clearly GWT is emulating Optional under the hood for internal code. Is it possible to export the Optional class as well?

At the moment it compiles, but gives me a warning:
[unusable-by-js] Return type of 'Optional MyClass.myMethod(String)' is not usable by but exposed to JavaScript.

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

No comments:

Post a Comment