Integrated: 8253944: Certain method references to VarHandle methods should fail

Paul Sandoz psandoz at openjdk.java.net
Mon Oct 5 17:18:45 UTC 2020


On Fri, 2 Oct 2020 17:38:19 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: b29e1086
Author:    Paul Sandoz <psandoz at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/b29e1086
Stats:     158 lines in 5 files changed: 125 ins; 13 del; 20 mod

8253944: Certain method references to VarHandle methods should fail

Reviewed-by: mcimadamore

-------------

PR: https://git.openjdk.java.net/jdk/pull/487


More information about the compiler-dev mailing list