Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8028690

Lambda Spec: Clarify how parameter/return types are derived for MethodHandle::invoke

XMLWordPrintable

    • Verified

      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.

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: