Thursday, September 10, 2020

Re: Weird type error in lambdas with generics, with JsInterop

Actually, I was able to pin-point to a small piece of code. 
My feeling is that it fails every time where the callback is a method reference which involved generic types.

JsInterop method called:
@JsType(isNative = true, name = "window", namespace = "<global>")
public class CordovaFileSystemGlobal {
    public static native void resolveLocalFileSystemURL(String url, FileSystemEntryCallback success, FileErrorCallback error);
}

In another, class Invocation:
public void resolveLocalFileSystemURL(String url, FileCallback<FileSystemEntry, com.inspectivity.go.client.filesystem.webkit.FileError> callback) {
    CordovaFileSystemGlobal.resolveLocalFileSystemURL(url, callback::onSuccess, callback::onFailure);
}

File Callback:
public interface FileCallback<S, E> {
         public void onSuccess(S entry);
         public void onFailure(E error);
}

/Thomas

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/CAAJnK2mS8dmRpwj1067t90qCvx%2BUCY0_1Garuhda5rBhVXo3Pw%40mail.gmail.com.

No comments:

Post a Comment