Hi,
We switched to gwt 2.7 and now i have a compilation failure
[ERROR] JSNI method JsPromise.thenJava(Lcom/codenvy/api/promises/client/Thenable;)Lcom/codenvy/api/promises/client/Promise; attempts to call method Thenable.then(Ljava/lang/Object;)Lcom/codenvy/api/promises/client/Thenable; on an instance which might be a JavaScriptObject. Such a method call is only allowed in pure Java (non-JSNI) functions.
The code in question does
@Override
public final <B> Promise<B> then(final Thenable<B> thenable) {
if (thenable instanceof JavaScriptObject) {
return this.thenJs((JavaScriptObject)thenable);
} else {
return this.thenJava(thenable);
}
}
private final native <B> Promise<B> thenJs(JavaScriptObject thenable) /*-{
return this.then(thenable);
}-*/;
private final native <B> Promise<B> thenJava(Thenable<B> thenable) /*-{
return this.then(function() {
then: function(arg) {
return thenable.@com.codenvy.api.promises.client.Thenable::then(*)(arg);
}
});
}-*/;
And there's a JSO implementation of the Thenale interface.
I've seen for example
https://code.google.com/p/google-web-toolkit/issues/detail?id=9008, but that's not the case as ThenJava will never be called with a JavaScripObject (unless I misunderstood).
So what's the problem?