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 allows modifiers in explicit requires of java.base #3151

Open
jarthana opened this issue Oct 24, 2024 · 3 comments · May be fixed by #3152
Open

ECJ allows modifiers in explicit requires of java.base #3151

jarthana opened this issue Oct 24, 2024 · 3 comments · May be fixed by #3152
Assignees

Comments

@jarthana
Copy link
Member

Consider this code:

module Test {
    exports a.b;
    requires static java.base;
}

As per the spec, it is illegal for modifiers to appear here. Same goes for transitive as well. Here's the text from 7.7.1:
If the declaration of a module expresses a dependence on the java.base module, and the module is not itself java.base, then it is a compile-time error if a modifier appears after the requires keyword.

@jarthana jarthana self-assigned this Oct 24, 2024
@jarthana jarthana added this to the 4.34 M3 milestone Oct 24, 2024
@jarthana jarthana linked a pull request Oct 24, 2024 that will close this issue
3 tasks
@stephan-herrmann
Copy link
Contributor

@jarthana
Copy link
Member Author

@jarthana have you seen https://mail.openjdk.org/pipermail/amber-spec-experts/2024-September/004213.html ? 😄

Ouch! Thanks for bringing it up, Stephan! I will remove the milestone and keep the PR just in case they change their mind again :)

@jarthana jarthana removed this from the 4.34 M3 milestone Oct 24, 2024
@stephan-herrmann
Copy link
Contributor

@jarthana have you seen https://mail.openjdk.org/pipermail/amber-spec-experts/2024-September/004213.html ? 😄

Ouch! Thanks for bringing it up, Stephan! I will remove the milestone and keep the PR just in case they change their mind again :)

Strictly speaking the error would be correct for existing Java versions, but if you don't want to iterate on this several times, then yes, waiting until the spec for JEP 494 stabilizes sounds like a good idea :)

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