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

Certain method references to VarHandle methods should fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b19

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psandoz Paul Sandoz
              Reporter:
              psandoz Paul Sandoz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: