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
8253944: Certain method references to VarHandle methods should fail #487
Conversation
|
@PaulSandoz The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
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.
Looks good!
@PaulSandoz This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
/integrate |
@PaulSandoz Since your change was applied there have been 13 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit b29e108. |
A regression was introduced in javac when processing method references to signature polymorphic methods whose return type is not polymorphic.
It is possible to successfully target type a method reference for a VarHandle sig-poly method to a functional interface whose methods return type is incompatible with the VarHandle method. This results in a runtime linkage error rather than a source compile time error.
See the following email thread for more details:
https://mail.openjdk.java.net/pipermail/compiler-dev/2020-October/015088.html
The fix is to "patch-back" the method's return type if it is not polymorphic. As a result it was possible to simplify the inference logic and keep it focused more on inference.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/487/head:pull/487
$ git checkout pull/487