You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bishabosha
changed the title
Cannot parse Java file with type annotations on array
Cannot parse Java file with type annotations on array or path selection
Feb 7, 2024
fan-tom
added a commit
to fan-tom/scala3
that referenced
this issue
Jan 16, 2025
…ava parser
Java parser doesn't expect an annotation in the next types, while it should:
- `Object @my.Ann []`
- `Object @my.Ann [] @my.OtherAnn []`
closesscala#19642
…java parser (#22391)
Closes#19642
Currently Java parser doesn't expect annotation between type name and
square brackets in an array type, or between pairs of square brackets in
nested array types.
I added a call to corresponding parser method `annotations` when parsing
array types.
I also changed an unnecessary `var` to `val`, as IDEA suggested.
Compiler version
3.4.0-RC4
Minimized code
Output
these errors do not appear all at the same time, but by commenting out the appropriate lines of one error to reveal another one.
Expectation
This is valid java accepted by Javac, see JLS 4.11. Note that this fails to parse in Scala 2.13 also
The text was updated successfully, but these errors were encountered: