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

Missing method reference lookup error when unbound search finds a static method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8, 8-repo-lambda
    • tools
    • b82

      This program should not compile:

      interface I {
        void zoo(Y y, String s);
      }

      class Y {
              void zoo(String s) {
                      System.out.println("Y.zoo(String)");
              }
              void zoo(Y y, String s) {
                      System.out.println("Y.zoo(Y, String)");
              }
      }


      public class X {
          public static void main(String[] args) {
                  I i = Y::zoo;
                  i.zoo(null, null);
              }
      }

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

              Created:
              Updated:
              Resolved: