RFR: 8253944: Certain method references to VarHandle methods should fail
psandoz at openjdk.java.net
Fri Oct 2 17:44:48 UTC 2020
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.
- 8253944: Certain method references to VarHandle methods should fail
Stats: 158 lines in 5 files changed: 125 ins; 13 del; 20 mod
Fetch: git fetch https://git.openjdk.java.net/jdk pull/487/head:pull/487
More information about the compiler-dev