A method reference with a compile-time declaration that is signature-polymorphic (MethodHandle.invoke or MethodHandle.invokeExact) gets special treatment in 15.12.3 when determining the parameter/return types of the invocation. The mapping from a method reference expression to a method invocation expression, for the purpose of deriving these types, is not spelled out.
Expected behavior:
- The types of the parameters are derived from the targeted function type's parameter types.
- The return type is 'void' if the targeted function type has a 'void' return, and Object otherwise.