Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10381

No compiler error for class that implements interfaces with duplicated default methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Consider the following:

      package p;
      public interface A {
        default void m() {}
      }
      public interface B {
        default void m() {}
      }
      
      class C implements p.A, p.B {
        void test() {
          m()
        }
      }
      

      groovyc does not detect that m() must be overridden to resolve the conflict. javac does produce an error, but it is still possible to import the interfaces from libraries and not trigger joint compilation.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: