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