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

Lambda Spec: Error if inherited static method hides an interface method

    Details

    • Subcomponent:
    • Verification:
      Verified

      Description

      In JLS 7, interface methods and static methods with override-equivalent signatures can both be inherited; this causes an error (8.4.8.4).

      class C { static void m() {} }
      interface I { void m(); }
      class D extends C implements I {} // error

      In the Lambda Spec, the interface method is not inherited, so the rule in 8.4.8.4 does not apply. Instead, the restriction that a static method cannot hide an instance method (8.4.8.2) needs to be extended to include _inherited_ static methods.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: