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

javac is mistakenly considering a missing enclosing instance error as an overload error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8, 9
    • tools
    • b59
    • Verified

        For a test case like:

        import java.util.concurrent.*;

        class Test {

            class Inner {}

            static void m(Callable<Inner> r) {}

            static void m1() {
                m(Inner::new);
            }
        }

        during the resolution of this method reference an error of kind MISSING_ENCL is generated, the issue is that as this kind is considered as an overload error, then the method reference is considered as overloaded which is incorrect. This provokes misleading error messages.

              vromero Vicente Arturo Romero Zaldivar
              vromero Vicente Arturo Romero Zaldivar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: