Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsFunction in native JsType method signature causes unusable-by-js warnings #9376

Closed
mbarkley opened this issue Jul 11, 2016 · 5 comments

Comments

@mbarkley
Copy link

commented Jul 11, 2016

The GWT compiler emits "unusable-by-js" warnings when a native JsType method has a JsFunction in the signature.

I've observed this while compiling applications using these types:

For projects with JS interop exports enabled, the GWT compiler emits warnings for every method in GlobalEventHandlers even though everything works as expected at runtime.

@rluble

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2016

You mean WITHOUT enabling -generateJsInteropExports right?

@rluble

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2016

Could not reproduce. Could you isolate a minimal repro case?

@mbarkley

This comment has been minimized.

Copy link
Author

commented Aug 5, 2016

I do not know the cause, but I am no longer able to reproduce this issue.

@rluble rluble closed this Aug 5, 2016

@mbarkley

This comment has been minimized.

Copy link
Author

commented Aug 8, 2016

Could we please reopen this issue? I've now figured out how to reproduce the issue and have created a reproducer. Please checkout this project and run mvn clean package to see the unusable-by-js warning in the console.

The warnings seem to appear when a native JsType has a method with a JsFunction parameter and the method is not used. You can see in the entrypoint of my reproducer that there is a commented out usage of such a method: when that line is uncommented the warning goes away.

@rluble rluble reopened this Aug 8, 2016

@rluble

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2016

Code review at https://gwt-review.googlesource.com/#/c/16540.

Thanks for the repro case.

@rluble rluble closed this Aug 11, 2016

@rluble rluble removed the ReviewPending label Aug 11, 2016

vasvir pushed a commit to BiovistaInc/gwt that referenced this issue Aug 12, 2016
Fix incorrect unusable-by-js warning.
@JsFunction interfaces were not completely loaded by UnifyAst
if the functional method was never called. This fact caused that
the interface was not considered as implementable externally, which
in turn confused restriction checker ending in a spurious warning.

Bug: gwtproject#9376
Bug-Link: gwtproject#9376
Change-Id: I92870fde72ab864bc42db8355e283ef3fe17d2ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.