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

Unable to qualify super in interface default method override

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      Combination of GROOVY-9909 and GROOVY-10381. Consider the following:

      package p;
      public interface A {
        default void m() {
          System.out.print("A");
        }
      }
      public interface B {
        default void m() {
          System.out.print("B");
        }
      }
      
      class C implements p.A, p.B {
        void m() {
          A.super.m() // The variable [A] is undeclared
        }
        void test() {
          m()
        }
      }
      

      It is required to override m() to disambiguate the interface default methods. However, it is not possible to disambiguate the "super" reference with a type qualifier.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: