8253944: Certain method references to VarHandle methods should fail #487
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:
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.
@PaulSandoz This change now passes all automated pre-integration checks.
After integration, the commit message for the final commit will be:
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
@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.