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

ECJ out of sync with JLS 9.6.4.1 #1096

Closed
srikanth-sankaran opened this issue May 26, 2023 · 2 comments · Fixed by #1097
Closed

ECJ out of sync with JLS 9.6.4.1 #1096

srikanth-sankaran opened this issue May 26, 2023 · 2 comments · Fixed by #1097
Assignees
Milestone

Comments

@srikanth-sankaran
Copy link
Contributor

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=552082

It appears that JDT went ahead and implemented the spec change https://bugs.openjdk.org/browse/JDK-8231435 eagerly.
It also appears that javac never implemented this change as can be seen from this snippet

@interface Simple {}
class Test { <@Simple T> void m(T arg1) {} }

being rejected by javac 14-20 with the diagnostic

X.java:2: error: annotation @Simple not applicable in this type context
class Test { <@Simple T> void m(T arg1) {} }
              ^
1 error

Now JLS has changed course with https://bugs.openjdk.org/browse/JDK-8261610 and javac also is implementing https://bugs.openjdk.org/browse/JDK-8303784

Current reading of JLS 9.6.4.1 :

...
If an annotation of type java.lang.annotation.Target is not present on the
declaration of an annotation interface A, then A is applicable in all declaration
contexts and in no type contexts.
...
@srikanth-sankaran
Copy link
Contributor Author

@srikanth-sankaran
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants