-
Notifications
You must be signed in to change notification settings - Fork 383
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
Missing sources for type annotations trip the compiler #10020
Comments
I got asked if I could share how to reproduce the trouble we've seen with this in Guava. It's pretty easy: Currently, we strip out our type-use nullness annotations to avoid that problem. So I pushed a commit to my Guava fork to stop stripping them. With that change, I can run
|
I've put up a PR with a test that reflects the six different ways that JDT can encounter annotations, and I think this simple fix will resolve this bug. |
JDT supports three kinds of annotations, and the ASTVisitor lets them be encountered in two different scopes. This patch ensures that all six cases are handled, and adds a test that uses each of the six cases - removing any one of the `visit` implementations will fail the test by incorrectly reporting the annotation as not having sources available. Fixes #10020
…#10021) JDT supports three kinds of annotations, and the ASTVisitor lets them be encountered in two different scopes. This patch ensures that all six cases are handled, and adds a test that uses each of the six cases - removing any one of the `visit` implementations will fail the test by incorrectly reporting the annotation as not having sources available. Fixes gwtproject#10020
JDT supports three kinds of annotations, and the ASTVisitor lets them be encountered in two different scopes. This patch ensures that all six cases are handled, and adds a test that uses each of the six cases - removing any one of the `visit` implementations will fail the test by incorrectly reporting the annotation as not having sources available. Fixes #10020 See #10021
We already strip `@Nullable` because of [a GWT bug with type-use annotations](gwtproject/gwt#10020) (recently fixed!). But because of our usages of `@NullMarked`, the `@Nullable` stripping makes all types non-null. To avoid that, we strip `@NullMarked`, too. RELNOTES=Changed our GWT/J2CL artifact to omit usages of `@NullMarked`. This was making all our types non-null in those environments, since we don't yet use `@Nullable` in the GWT/J2CL artifact. PiperOrigin-RevId: 696631127
We already strip `@Nullable` because of [a GWT bug with type-use annotations](gwtproject/gwt#10020) (recently fixed!). But because of our usages of `@NullMarked`, the `@Nullable` stripping makes all types non-null. To avoid that, we strip `@NullMarked`, too. RELNOTES=Changed our GWT/J2CL artifact to omit usages of `@NullMarked`. This was making all our types non-null in those environments, since we don't yet use `@Nullable` in the GWT/J2CL artifact. PiperOrigin-RevId: 696631127
We already strip `@Nullable` because of [a GWT bug with type-use annotations](gwtproject/gwt#10020) (recently fixed!). But because of our usages of `@NullMarked`, the `@Nullable` stripping makes all types non-null. To avoid that, we strip `@NullMarked`, too. RELNOTES=Changed our GWT/J2CL artifact to omit usages of `@NullMarked`. This was making all our types non-null in those environments, since we don't yet use `@Nullable` in the GWT/J2CL artifact. PiperOrigin-RevId: 700266827
GWT version: 2.11
Browser (with version): any
Operating System: Windows
Description
Some usages of annotations lead to missing source errrors.
Steps to reproduce
Usecase 1)
Usecase 2
Same issue also reproducible with j2objc annotations 2.8, depending on placement. Annotating a field is OK
Annotating an anonymous class is not
Known workarounds
Links to further discussions
google/jsinterop-base#19
The text was updated successfully, but these errors were encountered: