Parse Java annotations on array dimensions (Scala 3 backport)#11251
Open
mkurz wants to merge 1 commit into
Open
Parse Java annotations on array dimensions (Scala 3 backport)#11251mkurz wants to merge 1 commit into
mkurz wants to merge 1 commit into
Conversation
Backport the Scala 3 Java parser fix for annotations that appear before array brackets, such as String @nullable [] and nested annotated arrays. Scala 3 fixed the same parser gap in scala/scala3#22391. This applies the corresponding optArrayBrackets change to the Scala 2 Java parser and extends the existing Java type annotation positive test.
f249e76 to
a14ea6a
Compare
Contributor
Author
|
I amended the commit with one more test case for Java type-use annotations before varargs: void varargs(String @NotNull ... values) {}This mirrors the Scala 3 test added in This PR is ready now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport the Scala 3 Java parser fix for annotations that appear before array brackets, such as
String @Nullable []and nested annotated arrays.Scala 3 fixed the same parser gap in scala/scala3#22391. This applies the corresponding
optArrayBracketschange to the Scala 2 Java parser and extends the existing Java type annotation positive test.Scala 3 related issues/PRs/commits:
To reproduce:
J.javaNullable.javaCompiling with Java 8 works and produces class files:
The Scala 3.3 compiler accepts the files (does not create the class files however which I guess is expected):
Scala 2.13 fails: