-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Java parses leading annotation #20064
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
Conversation
if in.token == PACKAGE then | ||
if !leadingAnnots.isEmpty then | ||
//if (unit.source.file.name != "package-info.java") | ||
// syntaxError(pos, "package annotations must be in file package-info.java") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure scalac needs to enforce this javac rule if the annotations are not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think generally we don't add code to enforce Java rules that don't affect us in any way.
9fca170
to
637e421
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
object Test extends App { | ||
println { | ||
new JTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same remark as in scala 2) add reference to JFun and KTest?
if in.token == PACKAGE then | ||
if !leadingAnnots.isEmpty then | ||
//if (unit.source.file.name != "package-info.java") | ||
// syntaxError(pos, "package annotations must be in file package-info.java") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think generally we don't add code to enforce Java rules that don't affect us in any way.
Drafting to forward port the related annotations commits from Scala 2. |
@som-snytt I've merged the Scala 2 one. Does this one need to be updated or is it ready to go? |
@SethTisue I assume there is more annotations work to forward port, but I haven't had a chance (will) to look at it. Undrafting because it fixes something. I guess a solar eclipse can result in either a burst of productivity or a shadowed malaise. |
Motivated by #20026