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

Fix Java parsing of annotations on qualified types #21867

Conversation

dwijnand
Copy link
Member

According to #1 this is valid syntax:

java.lang.@NonNull String

Fixes #21319

@som-snytt
Copy link
Contributor

🤯 I was just looking at scala/bug#9883 and didn't even get there yet.

@dwijnand dwijnand marked this pull request as ready for review October 31, 2024 18:24
@dwijnand dwijnand requested a review from som-snytt October 31, 2024 18:24
@dwijnand
Copy link
Member Author

Happy to sign off on this fix, so at least it parses and the scala code can compile?

@som-snytt
Copy link
Contributor

som-snytt commented Oct 31, 2024

I can't tell at a glance if the test tests something. Should I backport to scala 2 and complain if it doesn't?

I just had lunch, so I have all afternoon PST to answer this question non-rhetorically.

Edit: I guess you're saying scalac does parse that private signature, even if no one is holding a knife to its throat.

Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll backport to confirm.

I hope I get a Java job on the basis of this iota of knowledge.

@dwijnand dwijnand merged commit d9d1047 into scala:main Nov 1, 2024
29 checks passed
@dwijnand dwijnand deleted the fix-java-parsing-annotations-on-qualified-types branch November 1, 2024 00:27
@WojciechMazur WojciechMazur added this to the 3.6.3 milestone Dec 9, 2024
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 this pull request may close these issues.

Fails to compile java code with a valid java annotation syntax.
3 participants