-
Notifications
You must be signed in to change notification settings - Fork 371
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
Emulation of Arrays triggers "unusable-by-js" warning #9592
Comments
The compiler builds the synthetic classes implementing lambdas upfront in GwtAstBuilder.java but does not propagate the suppressions. The simplest reasonable solution is to blindly add unusable-by-js suppressions to synthetic methods. The reasoning being that the check will be performed for the functional interface nonetheless and the warning will be emitted there where the user wrote the offending code. I'll gladly review the fix if anyone wants to tackle it. There are two places in GwtAstBuilder where these are created: JMethod has a fied that stores the suppressions. |
Also the synthetic method is not marked as such. Another possible solution is to mark it as synthetic (which should be done nonetheless) and skip synthetic methods from being checked. |
@rluble Patch to review https://gwt-review.googlesource.com/c/gwt/+/20440. |
Thanks @axls |
GWT version: HEAD and probably 2.8.2
Browser (with version): --
Operating System: --
Description
Compiling using GWT HEAD results in
The code in question already has a
@SuppressWarnings("unusable-by-js")
annotation, so I guess the compiler does not see it because of the method reference.The text was updated successfully, but these errors were encountered: