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

Lambda Spec: Error for static interface method invocation via an expression

XMLWordPrintable

    • Verified

      An error should occur when a static method in an interface is invoked via an expression qualifier (rather than unqualified or via a type).

      public class StaticInvoke {

        interface I {
          static void m() { m(); } // ok
        }
        
        void test(I arg) {
          I.m(); // ok
          arg.m(); // error
        }
      }

      javac already implements this error check, but the Lambda Spec does not include it.

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: