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

Enum and interface can't compile in on step

XMLWordPrintable

    • generic
    • generic

      public class Test {
       public static void main(String[] args) {
         for (E e : E.values()) {
           e.m();
         }
       }
      }

      interface I {
       void m();
      }

      enum E implements I {
       X {
         public void m() {}
       }
      }

      This won't compile with one call to javac.
      But if you separately compile I and E first you can then compile
      Test just fine.

            Unassigned Unassigned
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: