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

8279368: [lworld] Add parser support for declaration of value classes #596

Closed
wants to merge 1 commit into from

Conversation

sadayapalam
Copy link
Collaborator

@sadayapalam sadayapalam commented Jan 10, 2022

Enhance the parser to accept value class declarations


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8279368: [lworld] Add parser support for declaration of value classes

Reviewers

  • @biboudis (no known github.com user name / role)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/596/head:pull/596
$ git checkout pull/596

Update a local copy of the PR:
$ git checkout pull/596
$ git pull https://git.openjdk.java.net/valhalla pull/596/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 596

View PR using the GUI difftool:
$ git pr show -t 596

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/596.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 10, 2022

👋 Welcome back sadayapalam! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 10, 2022

@sadayapalam This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8279368: [lworld] Add parser support for declaration of value classes

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the lworld branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@sadayapalam
Copy link
Collaborator Author

sadayapalam commented Jan 10, 2022

Notes for reviewer:

- This patch ddds support for value classes in the parser
  using the value modifier or the __value__ annotation 
  (latter is temporary untils IDEs support value modifier)

- All that happens at the moment is, value class syntax is
  digested and a value classe is flagged as being one by 
  virtue of setting the Flags.VALUE_CLASS bit.

- This bit itself is "dropped" (ignored) by subsequent stages
  of the pipeline as of now

- Feature support base version level bumped up to 18

- Introduce the class file symbolic constant ACC_VALUE (0x100)

- Contains a bug fix - sometimes we were not emitting the best
  message for use of primitive/value classes with an inappropriate
  source level (instead of complaining "primitive/value classes are
  not supported in -source 17" we were instead complaining 
  "warning: 'primitive' may become a restricted type name in future"

- Fixed a singular -> plural grammar issue in diagnostics.

@mlbridge
Copy link

mlbridge bot commented Jan 10, 2022

Webrevs

@biboudis
Copy link
Member

This looks good to me 💯

I believe the following observations are not related to this PR so I am accepting it, but I would like to hear what you think:

  1. public native value class FooTest { } passes but also public native class FooTest { }. native shouldn't be applicable here at all here I think.

  2. An inconsistency in error reporting:

FooTest.java:2: error: repeated modifier
public native native class FooTest { }
              ^

but:

FooTest.java:2: error: class, interface, enum, or record expected
public value value class FooTest { }
       ^

What do you think?

@sadayapalam
Copy link
Collaborator Author

Thanks Aggelos, both observations are valid and I will raise follow up tickets to tackle them.

@sadayapalam
Copy link
Collaborator Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 10, 2022

Going to push as commit 063c1c4.

@openjdk openjdk bot added the integrated label Jan 10, 2022
@openjdk openjdk bot closed this Jan 10, 2022
@openjdk
Copy link

openjdk bot commented Jan 10, 2022

@sadayapalam Pushed as commit 063c1c4.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@sadayapalam sadayapalam deleted the JDK-8279368 branch January 10, 2022 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants