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

Certain method references to VarHandle methods should fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • 16
    • tools
    • None
    • b19

      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

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

              Created:
              Updated:
              Resolved: