regression in method reference type-checking

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 10
    • Affects Version/s: 9, 10
    • Component/s: tools
    • b26

      This program doesn't work as before:

      import java.util.function.BiFunction;

      public class Main {
          public static void main(String[] args1) {
              BiFunction<String, String, String> format = String::format;
              System.out.println(format.apply("foo %s", "bar")); // yields "foo bar" in java8, yields "bar" in java9

              BiFunction<String, Object, String> java9format = String::format;
              System.out.println(java9format.apply("foo %s", "bar")); // yields "foo bar" in java9
          }
      }

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: